Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 86abbac

Browse files
committed
[DEVOPS-1120] nix: Add source filtering and a releaseLib-style jobset
1 parent 91385d7 commit 86abbac

File tree

5 files changed

+53
-8
lines changed

5 files changed

+53
-8
lines changed

default.nix

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,15 @@
55
, gitrev ? iohkLib.commitIdFromGitRepo ./.
66
}:
77

8-
import ./nix/pkgs.nix { inherit pkgs; }
8+
let
9+
haskellPackages = import ./nix/pkgs.nix {
10+
inherit pkgs;
11+
src = iohkLib.cleanSourceHaskell ./.;
12+
};
13+
14+
in {
15+
inherit haskellPackages;
16+
17+
inherit (haskellPackages.cardano-shell.components)
18+
benchmarks exes library tests;
19+
}

nix/config.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

nix/pkgs.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
{ pkgs ? import <nixpkgs> {}
1+
{ args ? { config = import ./config.nix; }
2+
, pkgs ? import <nixpkgs> { inherit args; }
3+
, src ? ../.
24
}:
35
let
46
overrideWith = override: default:
@@ -57,6 +59,8 @@ let
5759
];
5860
modules = [
5961
haskell.ghcHackagePatches.${compiler}
62+
63+
{ packages.cardano-wallet.src = pkgs.lib.mkForce src; }
6064
];
6165
};
6266

release.nix

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
1-
with import ./default.nix {};
2-
{ cardano-shell = cardano-shell.components.exes.cardano-shell-exe;
3-
cardano-shell-tests = cardano-shell.components.tests;
4-
cardano-shell-library = cardano-shell.components.library;
5-
}
1+
############################################################################
2+
# Hydra release jobset
3+
#
4+
# Example build for Linux:
5+
#
6+
# nix-build release.nix -A exes.cardano-shell-exe.x86_64-linux
7+
#
8+
############################################################################
9+
10+
let
11+
iohkLib = import ./nix/iohk-common.nix { application = "cardano-sl"; };
12+
fixedNixpkgs = iohkLib.pkgs;
13+
14+
in { supportedSystems ? [ "x86_64-linux" ]
15+
, scrubJobs ? true
16+
, cardano-shell ? { outPath = ./.; rev = "abcdef"; }
17+
, nixpkgsArgs ? {
18+
config = (import ./nix/config.nix // { allowUnfree = false; inHydra = true; });
19+
gitrev = cardano-shell.rev;
20+
}
21+
}:
22+
23+
with (import (fixedNixpkgs.path + "/pkgs/top-level/release-lib.nix") {
24+
inherit supportedSystems scrubJobs nixpkgsArgs;
25+
packageSet = import cardano-shell.outPath;
26+
});
27+
28+
let
29+
jobs = mapTestOn {
30+
exes.cardano-shell-exe = supportedSystems;
31+
};
32+
33+
in
34+
jobs

shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
let
22
hsPkgs = import ./default.nix {};
3-
mainShell = hsPkgs.cardano-shell.components.all;
3+
mainShell = hsPkgs.haskellPackages.cardano-shell.components.all;
44
pkgs = import (import ./nixpkgs.nix) { config = import ./config.nix; };
55
runCoveralls = pkgs.stdenv.mkDerivation {
66
name = "run-coveralls";

0 commit comments

Comments
 (0)