on df2147d help sign in
haskell.nix/modules/stack-project.nix
94 lines 2.7 kB history raw
1{ lib, config, pkgs, haskellLib, ... }:
2with lib;
3with types;
4{
5 _file = "haskell.nix/modules/stack-project.nix";
6 options = {
7 # Used by callStackToNix
8 stackYaml = mkOption {
9 type = str;
10 default = "stack.yaml";
11 };
12 ignorePackageYaml = mkOption {
13 type = bool;
14 default = false;
15 };
16 cache = mkOption {
17 type = nullOr unspecified;
18 default = null;
19 };
20 stack-sha256 = mkOption {
21 type = nullOr str;
22 default = null;
23 };
24 resolverSha256 = mkOption {
25 type = nullOr str;
26 default = null;
27 };
28 materialized = mkOption {
29 type = nullOr (either path package);
30 default = null;
31 description = "Location of a materialized copy of the nix files";
32 };
33 checkMaterialization = mkOption {
34 type = nullOr bool;
35 default = null;
36 description = "If true the nix files will be generated used to check plan-sha256 and material";
37 };
38 nix-tools = mkOption {
39 type = package;
40 default = config.evalPackages.haskell-nix.internal-nix-tools; # When building stack projects we use the internal nix-tools (compiled with a fixed GHC version)
41 description = "nix-tools to use when converting the `plan.json` to nix";
42 };
44 # Used by mkStackPkgSet
45 pkg-def-extras = mkOption {
46 type = nullOr (listOf unspecified);
47 default = [];
48 };
49 modules = mkOption {
50 type = nullOr (listOf unspecified);
51 default = [];
52 };
53 extra-hackages = mkOption {
54 type = nullOr (listOf unspecified);
55 default = [];
56 };
58 # Used in stack-cache-generator.nix
59 sha256map = mkOption {
60 type = nullOr unspecified;
61 default = null;
62 description = ''
63 An alternative to adding `# nix-sha256:` comments into the
64 stack.yaml file:
65 sha256map =
66 { "https://github.com/jgm/pandoc-citeproc"."0.17"
67 = "0dxx8cp2xndpw3jwiawch2dkrkp15mil7pyx7dvd810pwc22pm2q"; };
68 '';
69 };
70 branchMap = mkOption {
71 type = nullOr unspecified;
72 default = null;
73 description = "A way to specify in which branch a git commit can be found";
74 };
75 lookupBranch = mkOption {
76 type = nullOr unspecified;
77 default = if config.branchMap != null
78 then { location, tag, ...}: config.branchMap.${location}.${tag} or null
79 else _: null;
80 };
82 # Used by stackProject itself
83 compiler-nix-name = mkOption {
84 type = nullOr str;
85 description = "The name of the ghc compiler to use eg. \"ghc884\"";
86 default = null;
87 };
88 ghc = mkOption {
89 type = nullOr package;
90 default = null;
91 description = "Deprecated in favour of `compiler-nix-name`";
92 };
93 };