1
0
Fork 0
mirror of https://github.com/numtide/flake-utils.git synced 2024-12-14 11:47:31 +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

16
lib.nix
View file

@ -48,17 +48,13 @@ let
)
{ }
(
systems
++
if
!builtins ? currentSystem || builtins.elem builtins.currentSystem systems
then
systems
else
# Add the current system if the --impure flag is used.
(
if
builtins ? currentSystem && !builtins.elem builtins.currentSystem systems
then
[ builtins.currentSystem ]
else
[ ]
)
systems ++ [ builtins.currentSystem ]
);
# eachSystemMap using defaultSystems