From 13916728ac45d4f3b7c9190a33e43588a4854dfa Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Sat, 1 Mar 2025 06:52:15 +0800 Subject: [PATCH] refactor: add system configuration builder function --- flake.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 89bbb16..977c833 100644 --- a/flake.nix +++ b/flake.nix @@ -9,13 +9,11 @@ ... } @ inputs: let args = {inherit self inputs;}; - in { - # System Configurations - nixosConfigurations = { - nemesis = nixpkgs.lib.nixosSystem { + mkSystem = hostname: + nixpkgs.lib.nixosSystem { specialArgs = args; modules = [ - ./systems/nemesis.nix + ./systems/${hostname}.nix # Add the home-manager user home-manager.nixosModules.home-manager @@ -33,8 +31,14 @@ } ]; }; - }; - + in { + # System Configurations + nixosConfigurations = builtins.listToAttrs [ + { + name = "nemesis"; + value = mkSystem "nemesis"; + } + ]; # Packages packages.x86_64-linux.nvf = (inputs.nvf.lib.neovimConfiguration {