flake.nix: Use foldl

This commit is contained in:
Florian RICHER 2024-04-08 00:43:06 +02:00
parent 35fc9a7c61
commit f8fc66d9ad

View file

@ -20,29 +20,22 @@
... ...
}: }:
let let
common-modules = [ systems = [
home-manager.nixosModules.home-manager { name = "nixos-test"; system = "x86_64-linux"; }
(import ./home/common-home-manager.nix { inherit inputs; }) { name = "perso-laptop"; system = "x86_64-linux"; }
{ name = "perso-desktop"; system = "x86_64-linux"; }
]; ];
in { in {
nixosConfigurations = { nixosConfigurations = nixpkgs.lib.foldl (c: s:
nixos-test = nixpkgs.lib.nixosSystem { c // {
system = "x86_64-linux"; ${s.name} = nixpkgs.lib.nixosSystem {
system = s.system;
modules = [ ./hosts/nixos-test ] ++ common-modules; modules = [
}; ./hosts/${s.name}
home-manager.nixosModules.home-manager
perso-laptop = nixpkgs.lib.nixosSystem { (import ./home/common-home-manager.nix { inherit inputs; })
system = "x86_64-linux"; ];
};
modules = [ ./hosts/perso-laptop ] ++ common-modules; }) {} systems;
};
perso-desktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./hosts/perso-desktop ] ++ common-modules;
};
};
}; };
} }