2024-11-11 14:21:34 +00:00
|
|
|
with import ./config.nix;
|
2012-01-26 13:04:50 +00:00
|
|
|
|
2024-09-18 10:42:20 +00:00
|
|
|
rec {
|
2012-01-26 13:04:50 +00:00
|
|
|
bar = mkDerivation {
|
|
|
|
name = "bar";
|
|
|
|
builder = builtins.toFile "builder.sh"
|
|
|
|
''
|
|
|
|
echo 'builtins.add 123 456' > $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2019-07-30 09:22:55 +00:00
|
|
|
value =
|
|
|
|
# Test that pathExists can check the existence of /nix/store paths
|
|
|
|
assert builtins.pathExists bar;
|
|
|
|
import bar;
|
2012-01-26 13:04:50 +00:00
|
|
|
|
2024-09-18 10:42:20 +00:00
|
|
|
result = mkDerivation {
|
|
|
|
name = "foo";
|
|
|
|
builder = builtins.toFile "builder.sh"
|
|
|
|
''
|
|
|
|
echo -n FOO${toString value} > $out
|
|
|
|
'';
|
|
|
|
};
|
2012-01-26 13:04:50 +00:00
|
|
|
|
2024-09-18 10:42:20 +00: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 13:04:50 +00:00
|
|
|
}
|