mirror of
https://github.com/srid/haskell-flake.git
synced 2024-09-11 05:55:25 +03:00
Fix settings.<name>.cabalFlags
implementation (#178)
* Fix cabalFlags implementation * Improve impl; add test * update changelog --------- Co-authored-by: Sridhar Ratnakumar <srid@srid.ca>
This commit is contained in:
parent
dfa5e263a9
commit
57cd506878
@ -9,7 +9,7 @@
|
|||||||
- `flake.haskellFlakeProjectModules`: Dropped all defaults, except the `output` module, which now exports `packages` and `settings`. Added a `defaults.projectModules.output` option that allows the user to override this module, or directly access the generated module.
|
- `flake.haskellFlakeProjectModules`: Dropped all defaults, except the `output` module, which now exports `packages` and `settings`. Added a `defaults.projectModules.output` option that allows the user to override this module, or directly access the generated module.
|
||||||
- Add `project.config.defaults.settings.default` defining sensible defaults for local packages.
|
- Add `project.config.defaults.settings.default` defining sensible defaults for local packages.
|
||||||
- Add `project.config.defaults.enable` to turn off all default settings en masse.
|
- Add `project.config.defaults.enable` to turn off all default settings en masse.
|
||||||
- Regressions in this PR: #169
|
- Regressions in this PR: #169, #178
|
||||||
|
|
||||||
## 0.3.0 (May 22, 2023)
|
## 0.3.0 (May 22, 2023)
|
||||||
|
|
||||||
|
@ -199,12 +199,11 @@ in
|
|||||||
'';
|
'';
|
||||||
impl = flags: drv:
|
impl = flags: drv:
|
||||||
let
|
let
|
||||||
enabled = lib.filterAttrs (_: v: v) flags;
|
fns = lib.flip lib.mapAttrsToList flags (flag: enabled:
|
||||||
disabled = lib.filterAttrs (_: v: !v) flags;
|
(if enabled then enableCabalFlag else disableCabalFlag) flag
|
||||||
enableCabalFlags = fs: drv: builtins.foldl' enableCabalFlag drv fs;
|
);
|
||||||
disableCabalFlags = fs: drv: builtins.foldl' disableCabalFlag drv fs;
|
|
||||||
in
|
in
|
||||||
lib.pipe drv [ enableCabalFlag disableCabalFlag ];
|
lib.pipe drv fns;
|
||||||
};
|
};
|
||||||
patches = {
|
patches = {
|
||||||
type = types.listOf types.path;
|
type = types.listOf types.path;
|
||||||
|
@ -52,6 +52,11 @@
|
|||||||
# the 'foo' package, we must override it here using `lib.mkForce`.
|
# the 'foo' package, we must override it here using `lib.mkForce`.
|
||||||
foo.source = lib.mkForce (inputs.haskell-multi-nix + /foo);
|
foo.source = lib.mkForce (inputs.haskell-multi-nix + /foo);
|
||||||
};
|
};
|
||||||
|
settings = {
|
||||||
|
foo = {
|
||||||
|
cabalFlags.blah = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
devShell = {
|
devShell = {
|
||||||
tools = hp: {
|
tools = hp: {
|
||||||
# Adding a tool should make it available in devshell.
|
# Adding a tool should make it available in devshell.
|
||||||
|
Loading…
Reference in New Issue
Block a user