forked from cdepillabout/stacklock2nix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-all-cabal-hashes-is-dir.nix
More file actions
55 lines (52 loc) · 2.03 KB
/
test-all-cabal-hashes-is-dir.nix
File metadata and controls
55 lines (52 loc) · 2.03 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ lib
, stacklock2nix
, haskell
, cabal-install
, fetchFromGitHub
}:
let
hasklib = haskell.lib.compose;
stacklock = stacklock2nix {
stackYaml = ../my-example-haskell-lib-easy/stack.yaml;
baseHaskellPkgSet = haskell.packages.ghc924;
additionalHaskellPkgSetOverrides = hfinal: hprev: {
# The servant-cassava.cabal file is malformed on GitHub:
# https://github.com/haskell-servant/servant-cassava/pull/29
servant-cassava =
hasklib.overrideCabal
{ editedCabalFile = null; revision = null; }
hprev.servant-cassava;
amazonka = hasklib.dontCheck hprev.amazonka;
amazonka-core = hasklib.dontCheck hprev.amazonka-core;
amazonka-sso = hasklib.dontCheck hprev.amazonka-sso;
amazonka-sts = hasklib.dontCheck hprev.amazonka-sts;
};
cabal2nixArgsOverrides = args: args // {
amazonka-sso = ver: { amazonka-test = null; };
amazonka-sts = ver: { amazonka-test = null; };
};
# XXX: Make sure to keep the call to fetchFromGitHub here, since it is
# testing that fetchCabalFileRevision is able to handle all-cabal-hashes
# being a directory. (fetchFromGitHub makes the output derivation a
# directory.)
all-cabal-hashes = fetchFromGitHub {
owner = "commercialhaskell";
repo = "all-cabal-hashes";
rev = "80869091dcb9f932c15fe57e30d4d0730c5f87df";
sha256 = "sha256-LAD3/5qeJWbzfqkcWccMOq0pHBnSkNnvBjWnlLzWFvQ=";
};
# This is an example of using the `locakPkgFilter` argument in order to
# filter out extra files that aren't needed.
#
# TODO: This should also actually test that the resulting derivation doesn't
# depend on `extra-file` existing or not existing (since it should be filtered
# out).
localPkgFilter = defaultLocalPkgFilter: pkgName: path: type:
# This filters out the file called `extra-file`
if pkgName == "my-example-haskell-lib" && baseNameOf path == "extra-file" then
false
else
defaultLocalPkgFilter path type;
};
in
stacklock.newPkgSet.my-example-haskell-app