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