migrate towards github:nix-systems instead
This commit is contained in:
parent
bc41f6cd48
commit
f3b09cb54f
1 changed files with 15 additions and 22 deletions
|
|
@ -1,21 +1,26 @@
|
|||
{lib, ...}: let
|
||||
# XXX: TODO: Move these helper functions into their own modules
|
||||
listToTrivialAttrs = values:
|
||||
builtins.listToAttrs (builtins.map (x: {
|
||||
name = x;
|
||||
value = x;
|
||||
})
|
||||
values);
|
||||
{
|
||||
crossLists,
|
||||
listToAttrsIdentity,
|
||||
...
|
||||
}: let
|
||||
# === Internal Helper Functions ===
|
||||
toSystemName = arch: platform: "${arch}-${platform}";
|
||||
listsToSystemNames = archs: platforms:
|
||||
crossLists (arch: platform: toSystemName arch platform)
|
||||
[
|
||||
(builtins.attrValues archs)
|
||||
(builtins.attrValues platforms)
|
||||
];
|
||||
in rec {
|
||||
# REF: https://github.com/nix-systems/nix-systems
|
||||
archs = listToTrivialAttrs [
|
||||
archs = listToAttrsIdentity [
|
||||
"x86_64"
|
||||
"aarch64"
|
||||
"riscv64"
|
||||
];
|
||||
|
||||
# REF: https://github.com/nix-systems/nix-systems
|
||||
platforms = listToTrivialAttrs [
|
||||
platforms = listToAttrsIdentity [
|
||||
"linux"
|
||||
"darwin"
|
||||
];
|
||||
|
|
@ -35,16 +40,4 @@ in rec {
|
|||
systems.x86_64 = listsToSystemNames [archs.x86_64] platforms;
|
||||
systems.aarch64 = listsToSystemNames [archs.aarch64] platforms;
|
||||
systems.riscv64 = listsToSystemNames [archs.riscv64] platforms;
|
||||
|
||||
# === Internal Helper Functions ===
|
||||
toSystemName = arch: platform: "${arch}-${platform}";
|
||||
listsToSystemNames = archs: platforms:
|
||||
lib.lists.crossLists (arch: platform: toSystemName arch platform)
|
||||
(with lib.attrsets; [
|
||||
(attrValues archs)
|
||||
(attrValues platforms)
|
||||
]);
|
||||
|
||||
# === External Functions ===
|
||||
# TODO
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue