Low-level derivations: Difference between revisions
→Nixpkgs utilities: cite writeShellScript |
→A Hello, world example: cite derivations from manual |
||
Line 7: | Line 7: | ||
{{File|example.sh|bash|#!/bin/bash | {{File|example.sh|bash|#!/bin/bash | ||
echo "Hello, world!"}} | echo "Hello, world!"}} | ||
When running this script (e.g. <code>$ ./example.sh</code>) we'll get exactly the output we want. However, we're trying to build the script using Nix. Our first approach might be to write a simple derivation similar to: | When running this script (e.g. <code>$ ./example.sh</code>) we'll get exactly the output we want. However, we're trying to build the script using Nix. Our first approach might be to write a simple derivation{{cite manual|nix|language/derivations|5.4.1|Derivations}} similar to: | ||
{{File|example.nix|nix|<nowiki>derivation { | {{File|example.nix|nix|<nowiki>derivation { | ||
name = "hello-world"; | name = "hello-world"; |