Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ in
name = mkOption {
type = types.str;
description = ''Name of the cabal package ("foo" if foo.cabal)'';
default = "";
};
root = mkOption {
type = types.path;
Expand All @@ -54,6 +53,7 @@ in
description = ''Overrides for the Cabal project'';
default = self: super: { };
};
# TODO: This option will go away after #7
modifier = mkOption {
type = functionTo types.package;
description = ''
Expand Down Expand Up @@ -159,9 +159,17 @@ in
hlint;
};
buildTools = lib.attrValues (defaultBuildTools hp // cfg.buildTools hp);
package = cfg.modifier (hp.callCabal2nixWithOptions cfg.name cfg.root "" { });
devShell = with pkgs.haskell.lib;
(addBuildTools package buildTools).envFunc { withHoogle = true; };
package' = hp.callCabal2nixWithOptions cfg.name cfg.root "" { };
package = cfg.modifier package';
devShell = (hp.extend (self: super: {
"${cfg.name}" = package';
})).shellFor {
packages = p: [
(cfg.modifier p."${cfg.name}")
];
withHoogle = true;
buildInputs = buildTools;
};
devShellCheck = name: command:
runCommandInSimulatedShell devShell cfg.root "${projectKey}-${name}-check" { } command;
in
Expand Down