mirror of
https://github.com/numtide/flake-utils.git
synced 2025-03-16 21:38:26 +00:00
lib: eachSystem: optimize hot path by assuming rare --impure usage
This commit is contained in:
parent
db82e07bd4
commit
58351e4428
1 changed files with 6 additions and 10 deletions
12
lib.nix
12
lib.nix
|
@ -47,18 +47,14 @@ let
|
||||||
) attrs (builtins.attrNames ret)
|
) attrs (builtins.attrNames ret)
|
||||||
)
|
)
|
||||||
{ }
|
{ }
|
||||||
(
|
|
||||||
systems
|
|
||||||
++
|
|
||||||
# Add the current system if the --impure flag is used.
|
|
||||||
(
|
(
|
||||||
if
|
if
|
||||||
builtins ? currentSystem && !builtins.elem builtins.currentSystem systems
|
!builtins ? currentSystem || builtins.elem builtins.currentSystem systems
|
||||||
then
|
then
|
||||||
[ builtins.currentSystem ]
|
systems
|
||||||
else
|
else
|
||||||
[ ]
|
# Add the current system if the --impure flag is used.
|
||||||
)
|
systems ++ [ builtins.currentSystem ]
|
||||||
);
|
);
|
||||||
|
|
||||||
# eachSystemMap using defaultSystems
|
# eachSystemMap using defaultSystems
|
||||||
|
|
Loading…
Add table
Reference in a new issue