Skip to content

Instantly share code, notes, and snippets.

@LnL7
Last active March 11, 2020 00:29
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 LnL7/c7a26317ec5714a7a04a97d4750cace7 to your computer and use it in GitHub Desktop.
Save LnL7/c7a26317ec5714a7a04a97d4750cace7 to your computer and use it in GitHub Desktop.
prefix=/tmp/foo
STORE="local?store=$prefix/store&state=$prefix/state&log=$prefix/log"
# builtin
nix-instantiate --store $STORE --eval -E 'builtins.toFile "hello" "Hello World!"'
# basic derivation
nix-build --store $STORE -E 'derivation { name = "hello"; builder = "/bin/sh"; args = ["-c" "echo echo hello world > $out"]; system = builtins.currentSystem; }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment