flake-parts/setups/nixos: fix images output build

This commit is contained in:
Gabriel Arazas 2024-01-16 18:57:33 +08:00
parent 1825a97c74
commit 6ae54e2b55
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -358,18 +358,25 @@ in
(host: metadata: (host: metadata:
metadata.formats != null && (lib.elem system metadata.systems)) metadata.formats != null && (lib.elem system metadata.systems))
cfg.configs; cfg.configs;
in
lib.mapAttrs' generateImages = name: metadata:
(host: metadata:
let let
name = metadata.hostname or host; images =
nixpkgs-channel = metadata.nixpkgs-channel or "nixpkgs"; builtins.map
in (format:
lib.nameValuePair name (mkImage { lib.nameValuePair
inherit (metadata) format; "${name}-${format}"
inherit nixpkgs-channel system; (mkImage {
inherit (metadata) nixpkgs-branch;
inherit system format;
extraModules = cfg.sharedModules ++ metadata.modules; extraModules = cfg.sharedModules ++ metadata.modules;
})) }))
metadata.formats;
in
lib.listToAttrs images;
in
lib.concatMapAttrs
(name: metadata: generateImages name metadata)
validImages; validImages;
}; };
}; };