1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 09:21:47 +02:00

nix repl: make symlinks with the :bl command

Requested by ppepino on the Matrix:
https://matrix.to/#/!KqkRjyTEzAGRiZFBYT:nixos.org/$Tb32BS3rVE2BSULAX4sPm0h6CDewX2hClOTGzTC7gwM?via=nixos.org&via=matrix.org&via=nixos.dev

This adds a new command, :bl, which works like :b but also creates
a GC root symlink to the various derivation outputs.

ckie@cookiemonster ~/git/nix -> ./outputs/out/bin/nix repl
Welcome to Nix 2.6.0. Type :? for help.

nix-repl> :l <nixpkgs>
Added 16118 variables.

nix-repl> :b runCommand "hello" {} "echo hi > $out"

This derivation produced the following outputs:
  ./repl-result-out -> /nix/store/kidqq2acdpi05c4a9mlbg2baikmzik44-hello
[1 built, 0.0 MiB DL]
ckie@cookiemonster ~/git/nix -> cat ./repl-result-out
hi
This commit is contained in:
ckie 2022-04-18 20:21:47 +03:00
parent ee57f91413
commit 0e2b01b14e
No known key found for this signature in database
GPG key ID: 13E79449C0525215
4 changed files with 31 additions and 9 deletions

View file

@ -1 +1,4 @@
# Release X.Y (202?-??-??)
* `nix repl` has a new build-'n-link (`:bl`) command that builds a derivation
while creating GC root symlinks.