mirror of
https://github.com/srid/haskell-flake.git
synced 2024-08-15 17:00:41 +03:00
Add outputs.checks
(#138)
This commit is contained in:
parent
bae56fa984
commit
c74e7c5967
@ -3,6 +3,7 @@
|
||||
## `master`
|
||||
|
||||
- #134: Add `autoWire` option to control generation of flake outputs
|
||||
- #138: Add `checks` to `outputs` submodule
|
||||
|
||||
## 0.2.0 (Mar 13, 2023)
|
||||
|
||||
|
@ -32,7 +32,13 @@ in
|
||||
'';
|
||||
default = false;
|
||||
};
|
||||
|
||||
drv = mkOption {
|
||||
type = types.package;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The `hlsCheck` derivation generated for this project.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
packageSubmodule = with types; submodule {
|
||||
@ -136,13 +142,14 @@ in
|
||||
The development shell derivation generated for this project.
|
||||
'';
|
||||
};
|
||||
hlsCheck = mkOption {
|
||||
type = types.package;
|
||||
checks = mkOption {
|
||||
type = types.lazyAttrsOf types.package;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The `hlsCheck` derivation generated for this project.
|
||||
The flake checks generated for this project.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
projectSubmodule = types.submoduleWith {
|
||||
@ -310,9 +317,8 @@ in
|
||||
checks =
|
||||
mergeMapAttrs
|
||||
(name: project:
|
||||
lib.optionalAttrs (project.autoWire && project.devShell.enable && project.devShell.hlsCheck.enable) {
|
||||
"${name}-hls" = project.outputs.hlsCheck;
|
||||
})
|
||||
lib.optionalAttrs project.autoWire project.outputs.checks
|
||||
)
|
||||
config.haskellProjects;
|
||||
};
|
||||
});
|
||||
|
@ -62,6 +62,11 @@ in
|
||||
++ builtins.attrValues (config.devShell.extraLibraries p);
|
||||
};
|
||||
});
|
||||
hlsCheck =
|
||||
runCommandInSimulatedShell
|
||||
devShell
|
||||
self "${projectKey}-hls-check"
|
||||
{ } "haskell-language-server";
|
||||
in
|
||||
{
|
||||
outputs = {
|
||||
@ -84,11 +89,12 @@ in
|
||||
(name: _: finalPackages."${name}")
|
||||
config.packages;
|
||||
|
||||
hlsCheck = runCommandInSimulatedShell
|
||||
devShell
|
||||
self "${projectKey}-hls-check"
|
||||
{ } "haskell-language-server";
|
||||
checks = lib.filterAttrs (_: v: v != null) {
|
||||
"${name}-hls" = if (config.devShell.enable && config.devShell.hlsCheck.enable) then hlsCheck else null;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
devShell.hlsCheck.drv = hlsCheck;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user