-
-
Save LnL7/a85365a952b4cc582c1bb68875704d37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ nix-build foo.nix -A hello | |
/nix/store/xmlhf8g9hgjycwwh7ac4i44ayc3wa9zg-hello | |
$ nix-build foo.nix -A menosandbox | |
these derivations will be built: | |
/nix/store/g95122z1j2i9hh24irapybc4pmz36fsa-evil.drv | |
building '/nix/store/g95122z1j2i9hh24irapybc4pmz36fsa-evil.drv'... | |
chmod: changing permissions of '/nix/store/xmlhf8g9hgjycwwh7ac4i44ayc3wa9zg-hello/bin/hello': Operation not permitted | |
builder for '/nix/store/g95122z1j2i9hh24irapybc4pmz36fsa-evil.drv' failed with exit code 1 | |
$ /nix/store/xmlhf8g9hgjycwwh7ac4i44ayc3wa9zg-hello/bin/hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; | |
rec { | |
hello = runCommand "hello" {} '' | |
mkdir -p $out/bin | |
cat <<-EOF > $out/bin/hello | |
#!/usr/bin/env bash | |
echo "Hello World!" | |
EOF | |
chmod +x $out/bin/hello | |
''; | |
menosandbox = runCommand "evil" { inherit hello; } '' | |
chmod -x $hello/bin/hello | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment