rename attrs.listToAttrsIdentity -> attrs.identityAttrsList
the name was easily confusable with listToAttrs which expects {name =
...; value = ...; } structure
This commit is contained in:
parent
4722d566ff
commit
3d2f657e9d
2 changed files with 9 additions and 9 deletions
|
|
@ -1,12 +1,9 @@
|
||||||
{lists}: rec {
|
{lists}: rec {
|
||||||
nameValuePair = name: value: {inherit name value;};
|
nameValuePair = name: value: {inherit name value;};
|
||||||
|
|
||||||
listToAttrsIdentity = values:
|
identityAttrs = value: {${value} = value;};
|
||||||
builtins.listToAttrs (
|
|
||||||
builtins.map
|
identityAttrsList = values: builtins.map (v: identityAttrs v) values;
|
||||||
(x: nameValuePair x x)
|
|
||||||
values
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Generate an attribute set by mapping a function over a list of
|
Generate an attribute set by mapping a function over a list of
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
{lists}: let
|
{
|
||||||
|
attrs,
|
||||||
|
lists,
|
||||||
|
}: let
|
||||||
# === Internal Helper Functions ===
|
# === Internal Helper Functions ===
|
||||||
toSystemName = arch: platform: "${arch}-${platform}";
|
toSystemName = arch: platform: "${arch}-${platform}";
|
||||||
listsToSystemNames = archs: platforms:
|
listsToSystemNames = archs: platforms:
|
||||||
|
|
@ -9,14 +12,14 @@
|
||||||
];
|
];
|
||||||
in rec {
|
in rec {
|
||||||
# REF: https://github.com/nix-systems/nix-systems
|
# REF: https://github.com/nix-systems/nix-systems
|
||||||
archs = lists.listToAttrsIdentity [
|
archs = attrs.identityAttrsList [
|
||||||
"x86_64"
|
"x86_64"
|
||||||
"aarch64"
|
"aarch64"
|
||||||
"riscv64"
|
"riscv64"
|
||||||
];
|
];
|
||||||
|
|
||||||
# REF: https://github.com/nix-systems/nix-systems
|
# REF: https://github.com/nix-systems/nix-systems
|
||||||
platforms = lists.listToAttrsIdentity [
|
platforms = attrs.identityAttrsList [
|
||||||
"linux"
|
"linux"
|
||||||
"darwin"
|
"darwin"
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue