2024-11-04 00:22:12 +02:00
|
|
|
with import ./config.nix;
|
2012-01-26 15:04:50 +02:00
|
|
|
|
2024-09-18 13:42:20 +03:00
|
|
|
rec {
|
2012-01-26 15:04:50 +02:00
|
|
|
bar = mkDerivation {
|
|
|
|
name = "bar";
|
|
|
|
builder = builtins.toFile "builder.sh"
|
|
|
|
''
|
|
|
|
echo 'builtins.add 123 456' > $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2019-07-30 12:22:55 +03:00
|
|
|
value =
|
|
|
|
# Test that pathExists can check the existence of /nix/store paths
|
|
|
|
assert builtins.pathExists bar;
|
|
|
|
import bar;
|
2012-01-26 15:04:50 +02:00
|
|
|
|
2024-09-18 13:42:20 +03:00
|
|
|
result = mkDerivation {
|
|
|
|
name = "foo";
|
|
|
|
builder = builtins.toFile "builder.sh"
|
|
|
|
''
|
|
|
|
echo -n FOO${toString value} > $out
|
|
|
|
'';
|
|
|
|
};
|
2012-01-26 15:04:50 +02:00
|
|
|
|
2024-09-18 13:42:20 +03:00
|
|
|
addPath = mkDerivation {
|
|
|
|
name = "add-path";
|
|
|
|
src = builtins.filterSource (path: type: true) result;
|
|
|
|
builder = builtins.toFile "builder.sh"
|
|
|
|
''
|
|
|
|
echo -n BLA$(cat $src) > $out
|
|
|
|
'';
|
|
|
|
};
|
2012-01-26 15:04:50 +02:00
|
|
|
}
|