Skip to content

Commit 8ef36cc

Browse files
committed
Move mkDerivation-for-ca to config.nix.in
That way it can be reused more generically
1 parent ca86783 commit 8ef36cc

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

t/jobs/config.nix.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ rec {
66
system = builtins.currentSystem;
77
PATH = path;
88
} // args);
9+
mkContentAddressedDerivation = args: mkDerivation ({
10+
__contentAddressed = true;
11+
outputHashMode = "recursive";
12+
outputHashAlgo = "sha256";
13+
} // args);
914
}

t/jobs/content-addressed.nix

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
let cfg = import ./config.nix; in
2-
let
3-
mkDerivation = args: cfg.mkDerivation ({
4-
__contentAddressed = true;
5-
outputHashMode = "recursive";
6-
outputHashAlgo = "sha256";
7-
} // args);
8-
in
92
{
103
empty_dir =
11-
mkDerivation {
4+
cfg.mkContentAddressedDerivation {
125
name = "empty-dir";
136
builder = ./empty-dir-builder.sh;
147
};
158

169
fails =
17-
mkDerivation {
10+
cfg.mkContentAddressedDerivation {
1811
name = "fails";
1912
builder = ./fail.sh;
2013
};
2114

2215
succeed_with_failed =
23-
mkDerivation {
16+
cfg.mkContentAddressedDerivation {
2417
name = "succeed-with-failed";
2518
builder = ./succeed-with-failed.sh;
2619
};

0 commit comments

Comments
 (0)