diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-09-21 19:15:50 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-09-22 00:18:59 +0200 |
commit | db2b37e31f1122da255f48956824586a8451b509 (patch) | |
tree | 005244897f620b969e4656a37e35f6e9dc3301db /hosts/default.nix | |
parent | mkHost: Add extraModules argument (diff) | |
download | nixos-config-db2b37e31f1122da255f48956824586a8451b509.tar.gz nixos-config-db2b37e31f1122da255f48956824586a8451b509.tar.bz2 nixos-config-db2b37e31f1122da255f48956824586a8451b509.zip |
Flake: Add systems as 'input' to the nix derivation
Diffstat (limited to '')
-rw-r--r-- | hosts/default.nix | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/hosts/default.nix b/hosts/default.nix index 2624f14..d1639b8 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,4 +1,4 @@ -{ lib, inputs, secrets, dotfiles, hosts, hardwares, isNixOS, isIso, isHardware, user, nixpkgs, home-manager, ... }: +{ lib, inputs, secrets, dotfiles, hosts, hardwares, systems, isNixOS, isIso, isHardware, user, nixpkgs, home-manager, ... }: let mkHost = { host, hardware, system, timezone, location, extraOverlays, extraModules }: isNixOS: isIso: isHardware: let @@ -7,6 +7,7 @@ let config = { allowUnfree = true; allowBroken = true; + allowUnsupportedSystem = true; }; overlays = [ inputs.nur.overlay @@ -53,11 +54,13 @@ let ]; }; - permutatedHosts = lib.concatMap (hardware: map (host: host // hardware) hosts) hardwares; + hardwarePermutatedHosts = lib.concatMap (hardware: map (host: host // hardware) hosts) hardwares; + systemsPermutatedHosts = lib.concatMap (system: map (host: host // system) hardwarePermutatedHosts) systems; + permutatedHosts = systemsPermutatedHosts; in /* We have a list of sets. Map each element of the list applying the mkHost function to its elements and returning a set in the listToAttrs format builtins.listToAttrs on the result */ -builtins.listToAttrs (map (mInput@{ host, hardware, ... }: { name = host + "-" + hardware; value = mkHost mInput isNixOS isIso isHardware; }) permutatedHosts) +builtins.listToAttrs (map (mInput@{ host, hardware, system, ... }: { name = host + "-" + hardware + "-" + system; value = mkHost mInput isNixOS isIso isHardware; }) permutatedHosts) |