mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-13 01:36:15 +02:00
85b9f4ef4f
This requires moving resolveSymlinks() into SourceAccessor. Also, it requires LocalStoreAccessor::maybeLstat() to work on parents of the store (to avoid an error like "/nix is not in the store"). Fixes #10375.
50 lines
997 B
Nix
50 lines
997 B
Nix
with import ./config.nix;
|
|
|
|
rec {
|
|
hello = mkDerivation {
|
|
name = "hello";
|
|
outputs = [ "out" "dev" ];
|
|
meta.outputsToInstall = [ "out" ];
|
|
buildCommand =
|
|
''
|
|
mkdir -p $out/bin $dev/bin
|
|
|
|
cat > $out/bin/hello <<EOF
|
|
#! ${shell}
|
|
who=\$1
|
|
echo "Hello \''${who:-World} from $out/bin/hello"
|
|
EOF
|
|
chmod +x $out/bin/hello
|
|
|
|
cat > $dev/bin/hello2 <<EOF
|
|
#! ${shell}
|
|
echo "Hello2"
|
|
EOF
|
|
chmod +x $dev/bin/hello2
|
|
'';
|
|
};
|
|
|
|
hello-symlink = mkDerivation {
|
|
name = "hello-symlink";
|
|
buildCommand =
|
|
''
|
|
ln -s ${hello} $out
|
|
'';
|
|
};
|
|
|
|
salve-mundi = mkDerivation {
|
|
name = "salve-mundi";
|
|
outputs = [ "out" ];
|
|
meta.outputsToInstall = [ "out" ];
|
|
buildCommand =
|
|
''
|
|
mkdir -p $out/bin
|
|
|
|
cat > $out/bin/hello <<EOF
|
|
#! ${shell}
|
|
echo "Salve Mundi from $out/bin/hello"
|
|
EOF
|
|
chmod +x $out/bin/hello
|
|
'';
|
|
};
|
|
}
|