Skip to content

Commit bd178bb

Browse files
author
jared
committed
Consolidated the repeated derivation for the golden tests
1 parent 1d806a1 commit bd178bb

File tree

2 files changed

+29
-38
lines changed

2 files changed

+29
-38
lines changed

testsuites/lbt-plutus/golden/build.nix

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
_:
22
{
33
perSystem = { pkgs, config, ... }:
4+
let
5+
goldenData = pkgs.stdenv.mkDerivation {
6+
name = "lbt-plutus-golden-data";
7+
src = ./.;
8+
# Disable the Fixup phase since it needs to (potentially) write to the
9+
# files in `./.` which are readonly in the nix store
10+
dontFixup = true;
11+
installPhase = ''ln -s "$src" "$out"'';
12+
};
13+
14+
in
415
{
516
packages = {
617
lbt-plutus-golden-haskell = config.lbf-nix.haskellData {
@@ -9,27 +20,11 @@ _:
920
cabalPackageName = "lbt-plutus-golden-data";
1021
};
1122

12-
lbt-plutus-golden-purescript = pkgs.stdenv.mkDerivation {
13-
name = "lbt-plutus-golden-data";
14-
src = ./.;
15-
phases = "installPhase";
16-
installPhase = "ln -s $src $out";
17-
};
18-
19-
lbt-plutus-golden-rust = pkgs.stdenv.mkDerivation {
20-
name = "lbt-plutus-golden-data";
21-
src = ./.;
22-
phases = "installPhase";
23-
installPhase = "ln -s $src $out";
24-
};
23+
lbt-plutus-golden-purescript = goldenData;
2524

26-
lbt-plutus-golden-typescript = pkgs.stdenv.mkDerivation {
27-
name = "lbt-plutus-golden-data";
28-
src = ./.;
29-
phases = "installPhase";
30-
installPhase = ''ln -s "$src" "$out"'';
31-
};
25+
lbt-plutus-golden-rust = goldenData;
3226

27+
lbt-plutus-golden-typescript = goldenData;
3328
};
3429

3530
};
Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
_:
22
{
33
perSystem = { pkgs, config, ... }:
4+
5+
let
6+
goldenData = pkgs.stdenv.mkDerivation {
7+
name = "lbt-prelude-golden-data";
8+
src = ./.;
9+
# Disable the Fixup phase since it needs to (potentially) write to the
10+
# files in `./.` which are readonly in the nix store
11+
dontFixup = true;
12+
installPhase = ''ln -s "$src" "$out"'';
13+
};
14+
in
415
{
516
devShells.dev-lbt-prelude-golden = config.devShells.default;
617

@@ -11,27 +22,12 @@ _:
1122
cabalPackageName = "lbt-prelude-golden-data";
1223
};
1324

14-
lbt-prelude-golden-purescript = pkgs.stdenv.mkDerivation {
15-
name = "lbt-prelude-golden-data";
16-
src = ./.;
17-
phases = "installPhase";
18-
installPhase = "ln -s $src $out";
19-
};
25+
lbt-prelude-golden-purescript = goldenData;
2026

21-
lbt-prelude-golden-rust = pkgs.stdenv.mkDerivation {
22-
name = "lbt-prelude-golden-data";
23-
src = ./.;
24-
phases = "installPhase";
25-
installPhase = "ln -s $src $out";
26-
};
27+
lbt-prelude-golden-rust = goldenData;
2728

28-
lbt-prelude-golden-typescript = pkgs.stdenv.mkDerivation {
29-
name = "lbt-prelude-golden-data";
30-
src = ./.;
31-
phases = "installPhase";
32-
installPhase = ''ln -s "$src" "$out"'';
33-
};
34-
};
29+
lbt-prelude-golden-typescript = goldenData;
3530

31+
};
3632
};
3733
}

0 commit comments

Comments
 (0)