1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
with import ./config.nix; { hello = mkDerivation { name = "hello"; buildCommand = '' mkdir -p $out/bin cat > $out/bin/hello <<EOF #! ${shell} who=\$1 echo "Hello \''${who:-World} from $out/bin/hello" EOF chmod +x $out/bin/hello ''; }; }