-
Notifications
You must be signed in to change notification settings - Fork 10
/
release.nix
39 lines (35 loc) · 1.26 KB
/
release.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
let versions = import ./versions.nix;
nix-thunk = import ./lib.nix {};
instances = builtins.listToAttrs (map (ghcVersion: {
name = ghcVersion;
value = nix-thunk.perGhc { ghc = ghcVersion; };
}) versions.ghc.supported);
preferredInstance = instances.${versions.ghc.preferred};
pkgs = preferredInstance.project.pkgs;
testsForInstance = name: this: {
inherit (this) command;
tests = import ./tests.nix {
inherit (this) command;
inherit (nix-thunk) packedThunkNixpkgs;
};
recurseForDerivations = true;
};
in {
# Instances of nix-thunk tested against different versions of its dependencies
byGhc =
builtins.mapAttrs testsForInstance instances //
{ recurseForDerivations = true; };
check-hlint = pkgs.runCommand "check-hlint" {
src = nix-thunk.haskellPackageSource;
buildInputs = [
(preferredInstance.project.tool "hlint" "latest")
];
} ''
set -euo pipefail
hlint --hint=${./.hlint.yaml} "$src"
touch "$out" # Make the derivation succeed if we get this far
'';
# Test the interface of default.nix. This should NOT be deduplicated, even if
# it is building the same derivations as other parts of this file.
command = (import ./default.nix {}).command;
}