mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-11 23:22:40 +02: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";
|
userfullname = "Ryan Yin";
|
||||||
useremail = "xiaoyin_c@qq.com";
|
useremail = "xiaoyin_c@qq.com";
|
||||||
|
|
||||||
|
inherit systemAttrs;
|
||||||
allSystems = builtins.attrValues systemAttrs;
|
allSystems = builtins.attrValues systemAttrs;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-14
@@ -18,20 +18,14 @@
|
|||||||
}
|
}
|
||||||
// inputs;
|
// inputs;
|
||||||
|
|
||||||
allSystemSpecialArgs = builtins.listToAttrs (
|
# mapAttrs'
|
||||||
map
|
# (name: value: nameValuePair ("foo_" + name) ("bar-" + value))
|
||||||
(attr: {
|
# { x = "a"; y = "b"; }
|
||||||
name = attr + "_specialArgs";
|
# => { foo_x = "bar-a"; foo_y = "bar-b"; }
|
||||||
value = specialArgsForSystem constants.${attr};
|
allSystemSpecialArgs = with lib.attrsets;
|
||||||
})
|
mapAttrs'
|
||||||
[
|
(name: value: nameValuePair (name + "_specialArgs") (specialArgsForSystem value))
|
||||||
"x64_system"
|
constants.systemAttrs;
|
||||||
"aarch64_system"
|
|
||||||
"riscv64_system"
|
|
||||||
"x64_darwin"
|
|
||||||
"aarch64_darwin"
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
args = lib.attrsets.mergeAttrsList [
|
args = lib.attrsets.mergeAttrsList [
|
||||||
inputs
|
inputs
|
||||||
|
|||||||
Reference in New Issue
Block a user