on 355cd37 help sign in
haskell.nix/modules/stack-project.nix
105 lines 3.0 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 caller = mkOption {
39 type = str;
40 default = "callCabalProjectToNix";
41 description = "Name of the calling function for better warning messages";
42 };
43 nix-tools = mkOption {
44 type = nullOr package;
45 default = pkgs.evalPackages.haskell-nix.internal-nix-tools;
46 description = "nix-tools to use when converting the `plan.json` to nix";
47 };
49 # Used by mkStackPkgSet
50 pkg-def-extras = mkOption {
51 type = nullOr (listOf unspecified);
52 default = [];
53 };
54 modules = mkOption {
55 type = nullOr (listOf unspecified);
56 default = [];
57 };
58 extra-hackages = mkOption {
59 type = nullOr (listOf unspecified);
60 default = [];
61 };
63 # Used in stack-cache-generator.nix
64 sha256map = mkOption {
65 type = nullOr unspecified;
66 default = null;
67 description = ''
68 An alternative to adding `# nix-sha256:` comments into the
69 stack.yaml file:
70 sha256map =
71 { "https://github.com/jgm/pandoc-citeproc"."0.17"
72 = "0dxx8cp2xndpw3jwiawch2dkrkp15mil7pyx7dvd810pwc22pm2q"; };
73 '';
74 };
75 lookupSha256 = mkOption {
76 type = nullOr unspecified;
77 default = if config.sha256map != null
78 then { location, tag, ...}: config.sha256map.${location}.${tag}
79 else _: null;
80 };
81 branchMap = mkOption {
82 type = nullOr unspecified;
83 default = null;
84 description = "A way to specify in which branch a git commit can be found";
85 };
86 lookupBranch = mkOption {
87 type = nullOr unspecified;
88 default = if config.branchMap != null
89 then { location, tag, ...}: config.branchMap.${location}.${tag} or null
90 else _: null;
91 };
93 # Used by stackProject itself
94 compiler-nix-name = mkOption {
95 type = nullOr str;
96 description = "The name of the ghc compiler to use eg. \"ghc884\"";
97 default = null;
98 };
99 ghc = mkOption {
100 type = nullOr package;
101 default = null;
102 description = "Deprecated in favour of `compiler-nix-name`";
103 };
104 };