From 37d398fd80707f5b06c8b1df83cb635b11dbb8be Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Sun, 25 Aug 2024 23:53:48 +0200 Subject: [PATCH] refactor flake --- flake.nix | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index 7178c7a..6ddf1e8 100644 --- a/flake.nix +++ b/flake.nix @@ -37,25 +37,17 @@ } { _module.args = { inherit hostname username; }; } ]; + + configureSystem = hostname: homeConfig: nixpkgs.lib.nixosSystem { + system = system; + modules = commonModules hostname ++ [ + { home-manager.users.${username} = import homeConfig; } + ]; + }; in { nixosConfigurations = { - vamos = - let hostname = "vamos"; - in nixpkgs.lib.nixosSystem { - system = system; - modules = commonModules hostname ++ [ - { home-manager.users.nezia = import ./home/laptop; } - ]; - }; - - solaire = let - hostname = "solaire"; - in nixpkgs.lib.nixosSystem { - system = system; - modules = commonModules hostname ++ [ - { home-manager.users.nezia = import ./home/desktop; } - ]; - }; + vamos = configureSystem "vamos" ./home/laptop; + solaire = configureSystem "solaire" ./home/desktop; }; }; }