mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2025-03-15 13:07:52 +00:00
Merge pull request #99 from hercules-ci/easyOverlay-remove-warning
easyOverlay: Remove performance warning which is not relevant
This commit is contained in:
commit
0944986217
2 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
toplevel@{ config, lib, flake-parts-lib, getSystem, ... }:
|
toplevel@{ config, lib, flake-parts-lib, getSystemIgnoreWarning, ... }:
|
||||||
let
|
let
|
||||||
inherit (flake-parts-lib)
|
inherit (flake-parts-lib)
|
||||||
mkPerSystemOption;
|
mkPerSystemOption;
|
||||||
|
@ -50,7 +50,7 @@ in
|
||||||
throw "Could not determine the `hostPlatform` of Nixpkgs. Was this overlay loaded as a Nixpkgs overlay, or was it loaded into something else?"
|
throw "Could not determine the `hostPlatform` of Nixpkgs. Was this overlay loaded as a Nixpkgs overlay, or was it loaded into something else?"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
perSys = (getSystem system).extendModules {
|
perSys = (getSystemIgnoreWarning system).extendModules {
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
_file = "flake-parts#flakeModules.easyOverlay/overlay-overrides";
|
_file = "flake-parts#flakeModules.easyOverlay/overlay-overrides";
|
||||||
|
|
|
@ -110,6 +110,12 @@ in
|
||||||
allSystems = genAttrs config.systems config.perSystem;
|
allSystems = genAttrs config.systems config.perSystem;
|
||||||
# TODO: Sub-optimal error message. Get Nix to support a memoization primop, or get Nix Flakes to support systems properly or get Nix Flakes to add a name to flakes.
|
# TODO: Sub-optimal error message. Get Nix to support a memoization primop, or get Nix Flakes to support systems properly or get Nix Flakes to add a name to flakes.
|
||||||
_module.args.getSystem = system: config.allSystems.${system} or (builtins.trace "using non-memoized system ${system}" config.perSystem system);
|
_module.args.getSystem = system: config.allSystems.${system} or (builtins.trace "using non-memoized system ${system}" config.perSystem system);
|
||||||
|
|
||||||
|
# The warning is there for a reason. Only use this in situations where the
|
||||||
|
# performance cost has already been incurred, such as in `flakeModules.easyOverlay`,
|
||||||
|
# where we run in the context of an overlay, and the performance cost of the
|
||||||
|
# extra `pkgs` makes the cost of running `perSystem` probably negligible.
|
||||||
|
_module.args.getSystemIgnoreWarning = system: config.allSystems.${system} or config.perSystem system;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue