mirror of
https://github.com/srid/haskell-flake.git
synced 2024-09-11 05:55:25 +03:00
Add autoWire
option, to control flake outputs (#134)
* Add autoWire option, to control flake outputs * add changelog
This commit is contained in:
parent
65c166728f
commit
2fde5d0cab
@ -1,5 +1,9 @@
|
|||||||
# Revision history for haskell-flake
|
# Revision history for haskell-flake
|
||||||
|
|
||||||
|
## `master`
|
||||||
|
|
||||||
|
- #134: Add `autoWire` option to control generation of flake outputs
|
||||||
|
|
||||||
## 0.2.0 (Mar 13, 2023)
|
## 0.2.0 (Mar 13, 2023)
|
||||||
|
|
||||||
- New features
|
- New features
|
||||||
|
@ -256,8 +256,17 @@ in
|
|||||||
This is an internal option, not meant to be set by the user.
|
This is an internal option, not meant to be set by the user.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
autoWire = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
Automatically wire up the project outputs to the flake outputs.
|
||||||
|
|
||||||
|
Disable this if you want to control the flake outputs
|
||||||
|
yourself. Useful, for example, when overriding the default
|
||||||
|
shell.
|
||||||
|
'';
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
@ -269,7 +278,6 @@ in
|
|||||||
description = "Haskell projects";
|
description = "Haskell projects";
|
||||||
type = types.attrsOf projectSubmodule;
|
type = types.attrsOf projectSubmodule;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config =
|
||||||
@ -290,19 +298,19 @@ in
|
|||||||
then packageName
|
then packageName
|
||||||
else "${name}-${packageName}";
|
else "${name}-${packageName}";
|
||||||
in
|
in
|
||||||
mapKeys dropDefaultPrefix project.outputs.localPackages)
|
lib.optionalAttrs project.autoWire (mapKeys dropDefaultPrefix project.outputs.localPackages))
|
||||||
config.haskellProjects;
|
config.haskellProjects;
|
||||||
devShells =
|
devShells =
|
||||||
mergeMapAttrs
|
mergeMapAttrs
|
||||||
(name: project:
|
(name: project:
|
||||||
lib.optionalAttrs project.devShell.enable {
|
lib.optionalAttrs (project.autoWire && project.devShell.enable) {
|
||||||
"${name}" = project.outputs.devShell;
|
"${name}" = project.outputs.devShell;
|
||||||
})
|
})
|
||||||
config.haskellProjects;
|
config.haskellProjects;
|
||||||
checks =
|
checks =
|
||||||
mergeMapAttrs
|
mergeMapAttrs
|
||||||
(name: project:
|
(name: project:
|
||||||
lib.optionalAttrs (project.devShell.enable && project.devShell.hlsCheck.enable) {
|
lib.optionalAttrs (project.autoWire && project.devShell.enable && project.devShell.hlsCheck.enable) {
|
||||||
"${name}-hls" = project.outputs.hlsCheck;
|
"${name}-hls" = project.outputs.hlsCheck;
|
||||||
})
|
})
|
||||||
config.haskellProjects;
|
config.haskellProjects;
|
||||||
|
Loading…
Reference in New Issue
Block a user