|
16 | 16 | { |
17 | 17 | options = { |
18 | 18 | perSystem = mkPerSystemOption |
19 | | - ({ config, self', inputs', pkgs, system, ... }: { |
20 | | - options.haskellProjects = mkOption { |
21 | | - description = "Haskell projects"; |
22 | | - type = types.attrsOf (types.submodule { |
| 19 | + ({ config, self', inputs', pkgs, system, ... }: |
| 20 | + let |
| 21 | + hlsCheckSubmodule = types.submodule { |
| 22 | + options = { |
| 23 | + enable = mkOption { |
| 24 | + type = types.bool; |
| 25 | + description = '' |
| 26 | + Whether to enable a flake check to verify that HLS works. |
| 27 | + |
| 28 | + This is equivalent to `nix develop -i -c haskell-language-server`. |
| 29 | +
|
| 30 | + Note that, HLS will try to access the network through Cabal (see |
| 31 | + https://github.com/haskell/haskell-language-server/issues/3128), |
| 32 | + therefore sandboxing must be disabled when evaluating this |
| 33 | + check. |
| 34 | + ''; |
| 35 | + default = false; |
| 36 | + }; |
| 37 | + |
| 38 | + }; |
| 39 | + }; |
| 40 | + hlintCheckSubmodule = types.submodule { |
| 41 | + options = { |
| 42 | + enable = mkOption { |
| 43 | + type = types.bool; |
| 44 | + description = "Whether to add a flake check to run hlint"; |
| 45 | + default = false; |
| 46 | + }; |
| 47 | + dirs = mkOption { |
| 48 | + type = types.listOf types.str; |
| 49 | + description = "Relative path strings from `root` to directories that should be checked with hlint"; |
| 50 | + default = [ "." ]; |
| 51 | + }; |
| 52 | + }; |
| 53 | + }; |
| 54 | + projectSubmodule = types.submodule { |
23 | 55 | options = { |
24 | 56 | haskellPackages = mkOption { |
25 | 57 | type = types.attrsOf raw; |
|
75 | 107 | }; |
76 | 108 | hlsCheck = mkOption { |
77 | 109 | default = { }; |
78 | | - type = types.submodule { |
79 | | - options = { |
80 | | - enable = mkOption { |
81 | | - type = types.bool; |
82 | | - description = '' |
83 | | - Whether to enable a flake check to verify that HLS works. |
84 | | - |
85 | | - This is equivalent to `nix develop -i -c haskell-language-server`. |
86 | | -
|
87 | | - Note that, HLS will try to access the network through Cabal (see |
88 | | - https://github.com/haskell/haskell-language-server/issues/3128), |
89 | | - therefore sandboxing must be disabled when evaluating this |
90 | | - check. |
91 | | - ''; |
92 | | - default = false; |
93 | | - }; |
94 | | - |
95 | | - }; |
96 | | - }; |
97 | | - }; |
98 | | - hlintCheck = mkOption { |
99 | | - default = { }; |
100 | | - type = types.submodule { |
101 | | - options = { |
102 | | - enable = mkOption { |
103 | | - type = types.bool; |
104 | | - description = "Whether to add a flake check to run hlint"; |
105 | | - default = false; |
106 | | - }; |
107 | | - dirs = mkOption { |
108 | | - type = types.listOf types.str; |
109 | | - description = "Relative path strings from `root` to directories that should be checked with hlint"; |
110 | | - default = [ "." ]; |
111 | | - }; |
112 | | - }; |
113 | | - }; |
| 110 | + type = hlsCheckSubmodule; |
114 | 111 | }; |
115 | 112 | }; |
116 | | - }); |
117 | | - }; |
118 | | - }); |
| 113 | + hlintCheck = mkOption { |
| 114 | + default = { }; |
| 115 | + type = hlintCheckSubmodule; |
| 116 | + }; |
| 117 | + }; |
| 118 | + in |
| 119 | + { |
| 120 | + options.haskellProjects = mkOption { |
| 121 | + description = "Haskell projects"; |
| 122 | + type = types.attrsOf projectSubmodule; |
| 123 | + }; |
| 124 | + }); |
119 | 125 | }; |
120 | 126 | config = { |
121 | 127 | perSystem = { config, self', inputs', pkgs, ... }: |
|
0 commit comments