Skip to content

Commit 83f9e95

Browse files
authored
Replace envFunc with shellFor; make name mandatory (#30)
1 parent c584317 commit 83f9e95

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

flake-module.nix

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ in
3838
name = mkOption {
3939
type = types.str;
4040
description = ''Name of the cabal package ("foo" if foo.cabal)'';
41-
default = "";
4241
};
4342
root = mkOption {
4443
type = types.path;
@@ -54,6 +53,7 @@ in
5453
description = ''Overrides for the Cabal project'';
5554
default = self: super: { };
5655
};
56+
# TODO: This option will go away after #7
5757
modifier = mkOption {
5858
type = functionTo types.package;
5959
description = ''
@@ -159,9 +159,17 @@ in
159159
hlint;
160160
};
161161
buildTools = lib.attrValues (defaultBuildTools hp // cfg.buildTools hp);
162-
package = cfg.modifier (hp.callCabal2nixWithOptions cfg.name cfg.root "" { });
163-
devShell = with pkgs.haskell.lib;
164-
(addBuildTools package buildTools).envFunc { withHoogle = true; };
162+
package' = hp.callCabal2nixWithOptions cfg.name cfg.root "" { };
163+
package = cfg.modifier package';
164+
devShell = (hp.extend (self: super: {
165+
"${cfg.name}" = package';
166+
})).shellFor {
167+
packages = p: [
168+
(cfg.modifier p."${cfg.name}")
169+
];
170+
withHoogle = true;
171+
buildInputs = buildTools;
172+
};
165173
devShellCheck = name: command:
166174
runCommandInSimulatedShell devShell cfg.root "${projectKey}-${name}-check" { } command;
167175
in

0 commit comments

Comments
 (0)