genSystems function

This commit is contained in:
Thibault “Adædra” Hamel 2024-05-28 23:48:26 +02:00
parent 0ada96086f
commit a00f3583af
2 changed files with 37 additions and 0 deletions

25
flake.lock Normal file
View File

@ -0,0 +1,25 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1716715802,
"narHash": "sha256-usk0vE7VlxPX8jOavrtpOqphdfqEQpf9lgedlY/r66c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

12
flake.nix Normal file
View File

@ -0,0 +1,12 @@
{
outputs = { self, nixpkgs }: {
lib = rec {
mergeFlakes = flakes: nixpkgs.lib.attrsets.foldAttrs (prev: i: prev // i) {} flakes;
genSystems = (systems: f:
(mergeFlakes (map (system:
builtins.mapAttrs (k: v: { "${system}" = v; }) (f (import nixpkgs { inherit system; }))
) systems))
);
};
};
}