2017-11-20 17:36:36 +00:00
|
|
|
with import ./config.nix;
|
|
|
|
|
|
|
|
{
|
|
|
|
hello = mkDerivation {
|
|
|
|
name = "hello";
|
2022-04-22 13:17:01 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
meta.outputsToInstall = [ "out" ];
|
2017-11-20 17:36:36 +00:00
|
|
|
buildCommand =
|
|
|
|
''
|
2022-04-22 13:17:01 +00:00
|
|
|
mkdir -p $out/bin $dev/bin
|
|
|
|
|
2017-11-20 17:36:36 +00:00
|
|
|
cat > $out/bin/hello <<EOF
|
|
|
|
#! ${shell}
|
|
|
|
who=\$1
|
|
|
|
echo "Hello \''${who:-World} from $out/bin/hello"
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/hello
|
2022-04-22 13:17:01 +00:00
|
|
|
|
|
|
|
cat > $dev/bin/hello2 <<EOF
|
|
|
|
#! ${shell}
|
|
|
|
echo "Hello2"
|
|
|
|
EOF
|
|
|
|
chmod +x $dev/bin/hello2
|
2017-11-20 17:36:36 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|