From 5474e411f4898b00014c1599bec4d26eb2741ad1 Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Thu, 8 Jan 2026 09:43:14 -0600 Subject: clean up nix-furnace --- flake.nix | 3 -- lib/nix-furnace/mkSystem.nix | 106 +++++++++++-------------------------------- 2 files changed, 26 insertions(+), 83 deletions(-) diff --git a/flake.nix b/flake.nix index d940a9a..6958a06 100644 --- a/flake.nix +++ b/flake.nix @@ -46,19 +46,16 @@ inherit inputs; hostname = "mercury"; username = "collin"; - module_types = ["hjem" "nixos"]; }; nixosConfigurations."jupiter" = mkNixosSystem { inherit inputs; hostname = "jupiter"; username = "collin"; - module_types = ["hjem" "nixos"]; }; nixosConfigurations."ganymede" = mkNixosSystem { inherit inputs; hostname = "ganymede"; username = "collin"; - module_types = ["nixos" "hjem"]; }; deploy.nodes."ganymede" = { diff --git a/lib/nix-furnace/mkSystem.nix b/lib/nix-furnace/mkSystem.nix index e547eb2..85f952c 100644 --- a/lib/nix-furnace/mkSystem.nix +++ b/lib/nix-furnace/mkSystem.nix @@ -8,10 +8,9 @@ let inputs, hostname, username, - module_types, }: inputs.nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs my-lib hostname;}; + specialArgs = {inherit inputs my-lib;}; modules = [ {networking.hostName = hostname;} @@ -33,87 +32,34 @@ let |> my-lib.flatten); } - # Home-sided modules - ( - if (builtins.elem "home" module_types) - then { - imports = [ - inputs.home-manager.nixosModules.home-manager - ]; - home-manager = { - backupFileExtension = "bak"; - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = {inherit inputs my-lib;}; - users.${username} = { - imports = - [ - ../../modules/options.nix - ../../hosts/${hostname}/config.nix - (lazyImport ../../hosts/${hostname}/home.nix) - { - home.preferXdgDirectories = true; - } - ] - ++ (listModules - |> (builtins.map (modName: [ - (lazyImport ../../modules/${modName}/options.nix) - (lazyImport ../../modules/${modName}/home/default.nix) - ])) - |> my-lib.flatten); - }; - }; - } - else {} - ) - # Hjem-sided modules - ( - if (builtins.elem "hjem" module_types) - then { - imports = [ - inputs.hjem.nixosModules.hjem - ]; - hjem = { - extraModules = - [ - ../../modules/options.nix - ../../hosts/${hostname}/config.nix - (lazyImport ../../hosts/${hostname}/hjem.nix) - ] - ++ (listModules - |> (builtins.map (modName: [ - (lazyImport ../../modules/${modName}/options.nix) - (lazyImport ../../modules/${modName}/hjem/default.nix) - ])) - |> my-lib.flatten); - specialArgs = {inherit inputs my-lib;}; - users.${username} = { - enable = true; - user = username; - directory = "/home/${username}"; - }; + { + imports = [ + inputs.hjem.nixosModules.hjem + ]; + hjem = { + extraModules = + [ + ../../modules/options.nix + ../../hosts/${hostname}/config.nix + (lazyImport ../../hosts/${hostname}/hjem.nix) + ] + ++ (listModules + |> (builtins.map (modName: [ + (lazyImport ../../modules/${modName}/options.nix) + (lazyImport ../../modules/${modName}/hjem/default.nix) + ])) + |> my-lib.flatten); + specialArgs = {inherit inputs my-lib;}; + users.${username} = { + enable = true; + user = username; + directory = "/home/${username}"; }; - } - else {} - ) + }; + } ]; }; - - mkSystemManagerSystem = { - inputs, - hostname, - }: - inputs.system-manager.lib.makeSystemConfig { - modules = - [../../modules/options.nix ../../hosts/${hostname}/system.nix] - ++ (listModules - |> (builtins.map (modName: [ - (lazyImport ../../modules/${modName}/options.nix) - (lazyImport ../../modules/${modName}/system/default.nix) - ])) - |> my-lib.flatten); - }; in { - inherit mkNixosSystem mkSystemManagerSystem; + inherit mkNixosSystem; } -- cgit v1.3.1