Skip to content

Commit

Permalink
Move mkDerivation-for-ca to config.nix.in
Browse files Browse the repository at this point in the history
That way it can be reused more generically
  • Loading branch information
thufschmitt committed Apr 28, 2021
1 parent ca86783 commit 8ef36cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
5 changes: 5 additions & 0 deletions t/jobs/config.nix.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ rec {
system = builtins.currentSystem;
PATH = path;
} // args);
mkContentAddressedDerivation = args: mkDerivation ({
__contentAddressed = true;
outputHashMode = "recursive";
outputHashAlgo = "sha256";
} // args);
}
13 changes: 3 additions & 10 deletions t/jobs/content-addressed.nix
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
let cfg = import ./config.nix; in
let
mkDerivation = args: cfg.mkDerivation ({
__contentAddressed = true;
outputHashMode = "recursive";
outputHashAlgo = "sha256";
} // args);
in
{
empty_dir =
mkDerivation {
cfg.mkContentAddressedDerivation {
name = "empty-dir";
builder = ./empty-dir-builder.sh;
};

fails =
mkDerivation {
cfg.mkContentAddressedDerivation {
name = "fails";
builder = ./fail.sh;
};

succeed_with_failed =
mkDerivation {
cfg.mkContentAddressedDerivation {
name = "succeed-with-failed";
builder = ./succeed-with-failed.sh;
};
Expand Down

0 comments on commit 8ef36cc

Please sign in to comment.