From d429fbd1d687d22edc04902eb2787757b17aa086 Mon Sep 17 00:00:00 2001 From: smayzy Date: Thu, 14 Aug 2025 15:04:49 +0200 Subject: [PATCH] rewite flake.nix host deffinition --- flake.nix | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/flake.nix b/flake.nix index 5c2192d..251b038 100644 --- a/flake.nix +++ b/flake.nix @@ -29,37 +29,25 @@ let system = "x86_64-linux"; overlays = builtins.attrValues (import ./overlays); + + sharedModules = [ + nix-flatpak.nixosModules.nix-flatpak + inputs.stylix.nixosModules.stylix + nvf.nixosModules.default + ]; + + mkHost = hostConfig: + nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs system overlays; }; + modules = [ hostConfig ] ++ sharedModules; + }; in { nixosConfigurations = { - desktop1 = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs system overlays; }; - modules = [ - ./hosts/desktop1/configuration.nix - nix-flatpak.nixosModules.nix-flatpak - inputs.stylix.nixosModules.stylix - nvf.nixosModules.default - ]; - }; - server1 = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs system overlays; }; - modules = [ - ./hosts/server1/configuration.nix - nix-flatpak.nixosModules.nix-flatpak - inputs.stylix.nixosModules.stylix - nvf.nixosModules.default - ]; - }; - laptop1 = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs system overlays; }; - modules = [ - ./hosts/laptop1/configuration.nix - nix-flatpak.nixosModules.nix-flatpak - inputs.stylix.nixosModules.stylix - nvf.nixosModules.default - ]; - }; + desktop1 = mkHost ./hosts/desktop1/configuration.nix; + server1 = mkHost ./hosts/server1/configuration.nix; + laptop1 = mkHost ./hosts/laptop1/configuration.nix; }; };