mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-25 19:01:43 +01:00
refactor: replace listToAttrs with mapAttrs' to get a cleaner definition
This commit is contained in:
@@ -14,5 +14,6 @@ in systemAttrs // {
|
||||
userfullname = "Ryan Yin";
|
||||
useremail = "xiaoyin_c@qq.com";
|
||||
|
||||
inherit systemAttrs;
|
||||
allSystems = builtins.attrValues systemAttrs;
|
||||
}
|
||||
|
||||
@@ -18,20 +18,14 @@
|
||||
}
|
||||
// inputs;
|
||||
|
||||
allSystemSpecialArgs = builtins.listToAttrs (
|
||||
map
|
||||
(attr: {
|
||||
name = attr + "_specialArgs";
|
||||
value = specialArgsForSystem constants.${attr};
|
||||
})
|
||||
[
|
||||
"x64_system"
|
||||
"aarch64_system"
|
||||
"riscv64_system"
|
||||
"x64_darwin"
|
||||
"aarch64_darwin"
|
||||
]
|
||||
);
|
||||
# mapAttrs'
|
||||
# (name: value: nameValuePair ("foo_" + name) ("bar-" + value))
|
||||
# { x = "a"; y = "b"; }
|
||||
# => { foo_x = "bar-a"; foo_y = "bar-b"; }
|
||||
allSystemSpecialArgs = with lib.attrsets;
|
||||
mapAttrs'
|
||||
(name: value: nameValuePair (name + "_specialArgs") (specialArgsForSystem value))
|
||||
constants.systemAttrs;
|
||||
|
||||
args = lib.attrsets.mergeAttrsList [
|
||||
inputs
|
||||
|
||||
Reference in New Issue
Block a user