Skip to content

Instantly share code, notes, and snippets.

@grahamc
Created December 6, 2017 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/0349b3e425e5a823946608205fc30c8f to your computer and use it in GitHub Desktop.
Save grahamc/0349b3e425e5a823946608205fc30c8f to your computer and use it in GitHub Desktop.
$ nix-repl
Welcome to Nix version 1.11.15. Type :? for help.
nix-repl> :l <nixpkgs>
Added 7876 variables.
nix-repl> simple = derivation { name = "simple"; builder = "${bash}/bin/bash"; args = [ ./simple_builder.sh ]; gcc = gcc; coreutils = coreutils; src = ./simple.c; system = builtins.currentSystem; }
nix-repl> :b simple
these derivations will be built:
/nix/store/dyd9yhalxh55bq2mmr5z3gzp0sm5ngd5-simple.drv
building path(s) ‘/nix/store/ipij0gvkrcc5269izv9qw2a0xkr6g48x-simple’
/nix/store/3pmhqksyv8z241j8rc6m0s6my93vi6bh-simple.c: In function 'main':
/nix/store/3pmhqksyv8z241j8rc6m0s6my93vi6bh-simple.c:2:5: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
puts("Simple!");
^~~~
warning: you did not specify ‘--add-root’; the result might be removed by the garbage collector
/nix/store/ipij0gvkrcc5269izv9qw2a0xkr6g48x-simple
this derivation produced the following outputs:
out -> /nix/store/ipij0gvkrcc5269izv9qw2a0xkr6g48x-simple
nix-repl>
[nix-shell:~/projects/nixpkgs]$ /nix/store/ipij0gvkrcc5269izv9qw2a0xkr6g48x-simple/simple
Simple!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment