From 35fc9a7c61bf79538be29f1fe0ee7a47a893472c Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Mon, 8 Apr 2024 00:06:14 +0200 Subject: [PATCH] flake.nix: Refactor common modules --- flake.nix | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index 50a1f62..f44acf9 100644 --- a/flake.nix +++ b/flake.nix @@ -18,36 +18,30 @@ home-manager, nix-flatpak, ... - }: { + }: + let + common-modules = [ + home-manager.nixosModules.home-manager + (import ./home/common-home-manager.nix { inherit inputs; }) + ]; + in { nixosConfigurations = { nixos-test = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [ - ./hosts/nixos-test - home-manager.nixosModules.home-manager - (import ./home/common-home-manager.nix { inherit inputs; }) - ]; + modules = [ ./hosts/nixos-test ] ++ common-modules; }; perso-laptop = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [ - ./hosts/perso-laptop - home-manager.nixosModules.home-manager - (import ./home/common-home-manager.nix { inherit inputs; }) - ]; + modules = [ ./hosts/perso-laptop ] ++ common-modules; }; perso-desktop = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [ - ./hosts/perso-desktop - home-manager.nixosModules.home-manager - (import ./home/common-home-manager.nix { inherit inputs; }) - ]; + modules = [ ./hosts/perso-desktop ] ++ common-modules; }; }; };