diff --git a/nib/std/attrs.nix b/nib/std/attrs.nix index b65af4c..863f2ae 100644 --- a/nib/std/attrs.nix +++ b/nib/std/attrs.nix @@ -1,12 +1,9 @@ {lists}: rec { nameValuePair = name: value: {inherit name value;}; - listToAttrsIdentity = values: - builtins.listToAttrs ( - builtins.map - (x: nameValuePair x x) - values - ); + identityAttrs = value: {${value} = value;}; + + identityAttrsList = values: builtins.map (v: identityAttrs v) values; /** Generate an attribute set by mapping a function over a list of diff --git a/nib/sys/default.nix b/nib/sys/default.nix index 7c6cffb..a4a7c35 100644 --- a/nib/sys/default.nix +++ b/nib/sys/default.nix @@ -1,4 +1,7 @@ -{lists}: let +{ + attrs, + lists, +}: let # === Internal Helper Functions === toSystemName = arch: platform: "${arch}-${platform}"; listsToSystemNames = archs: platforms: @@ -9,14 +12,14 @@ ]; in rec { # REF: https://github.com/nix-systems/nix-systems - archs = lists.listToAttrsIdentity [ + archs = attrs.identityAttrsList [ "x86_64" "aarch64" "riscv64" ]; # REF: https://github.com/nix-systems/nix-systems - platforms = lists.listToAttrsIdentity [ + platforms = attrs.identityAttrsList [ "linux" "darwin" ];