From a8e19d23b4c3edbf3c875251d8d714f7efefe929 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig <Zynh0722@gmail.com> Date: Wed, 26 Feb 2025 05:23:58 -0800 Subject: [PATCH] WIP: migrate to using builders flake module --- flake.nix | 47 +++++++++++++++++++++------------- flakeModules/builders/util.nix | 3 --- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/flake.nix b/flake.nix index ab1a3f0..4db4189 100644 --- a/flake.nix +++ b/flake.nix @@ -30,25 +30,36 @@ outputs = inputs@{ flake-parts, deploy-rs, nixpkgs, self, ... }: flake-parts.lib.mkFlake { inherit inputs; } { - # imports = [ ./flakeModules/builders.nix ]; - # + imports = [ ./flakeModules/builders ]; + + builders = { + configurations.nixos = [ + { hostname = "snowhawk"; } + ]; + + configurations.darwin = [ + { hostname = "lynx"; } + ]; + + configurations.home = [ + { user = "zynh"; hostname = "msiserver"; } + { user = "val"; hostname = "caveserver"; } + { user = "ravenshade"; hostname = "permafrost"; } + ]; + + nixosModules = [ + inputs.home-manager.nixosModules.default + inputs.chaotic.nixosModules.default + inputs.niri.nixosModules.niri + ]; + + homeModules = [ + inputs.chaotic.homeManagerModules.default + ]; + }; + flake = - let builders = import ./builders.nix inputs; - in { - nixosConfigurations = builders.compileNixosSystems [ - { hostname = "snowhawk"; } - ]; - - darwinConfigurations = builders.compileDarwinSystems [ - { hostname = "lynx"; } - ]; - - homeConfigurations = builders.compileHomes [ - { user = "zynh"; hostname = "msiserver"; } - { user = "val"; hostname = "caveserver"; } - { user = "ravenshade"; hostname = "permafrost"; } - ]; - + { deploy = let homeConfigPath = username: deploy-rs.lib.x86_64-linux.activate.home-manager self.homeConfigurations.${username}; in { diff --git a/flakeModules/builders/util.nix b/flakeModules/builders/util.nix index 23186ff..35ec1e5 100644 --- a/flakeModules/builders/util.nix +++ b/flakeModules/builders/util.nix @@ -75,8 +75,6 @@ rec { ./hosts/${hostname}/hardware-configuration.nix ./hosts/${hostname}/configuration.nix inputs.home-manager.nixosModules.default - inputs.chaotic.nixosModules.default - inputs.niri.nixosModules.niri { home-manager.extraSpecialArgs = { inherit inputs self pkgs; @@ -100,7 +98,6 @@ rec { extraSpecialArgs = { inherit inputs self; }; modules = [ - inputs.chaotic.homeManagerModules.default ./hosts/${configHost}/home.nix ]; });