1
0
Fork 0
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:
NAHO 2024-09-16 15:18:48 +02:00
parent db82e07bd4
commit 58351e4428
No known key found for this signature in database
GPG key ID: 229CB671D09B95F5

12
lib.nix
View file

@ -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