From 215ad6b1a7b5bb9b6d5b15113da01d43bc1c7078 Mon Sep 17 00:00:00 2001 From: Bun Date: Sat, 31 May 2025 17:47:49 -0400 Subject: [PATCH] Simplify flake readability, move NixOS configs outside of flake-utils --- flake.nix | 65 +++++++++++------------ modules/home/profiles/default.nix | 5 +- modules/home/profiles/generic/default.nix | 8 --- 3 files changed, 33 insertions(+), 45 deletions(-) delete mode 100644 modules/home/profiles/generic/default.nix diff --git a/flake.nix b/flake.nix index 85a531aa..0e2d34bb 100644 --- a/flake.nix +++ b/flake.nix @@ -52,40 +52,39 @@ outputs = inputs: with inputs; - flake-utils.lib.eachDefaultSystemPassThrough (system: - let - mkNix = name: channel: channel.lib.nixosSystem { - modules = [ (./hosts + "/${name}") ]; - specialArgs = inputs; - }; - mkHome = extraModules: hm.lib.homeManagerConfiguration { - modules = [ - ./modules/home - { targets.genericLinux.enable = true; } - ] ++ extraModules; - extraSpecialArgs = inputs; - pkgs = builtins.getAttr system stable.legacyPackages; - }; + let + mkNix = name: channel: channel.lib.nixosSystem { + modules = [ (./hosts + "/${name}") ]; + specialArgs = inputs; + }; + in { + nixosConfigurations = builtins.mapAttrs (name: channel: mkNix name channel) { + tower = stable; + detritus = stable; + hidden = stable; - hostChannels = { - tower = stable; - detritus = stable; - hidden = stable; + intuos = stable; + jupiter = unstable; - intuos = stable; - jupiter = unstable; + midas = stable; + kitty = stable; + prophet = stable; + }; + } - midas = stable; - kitty = stable; - prophet = stable; - }; - in { - nixosConfigurations = builtins.mapAttrs (name: channel: mkNix name channel) hostChannels; - - homeConfigurations = { - default = mkHome [ ]; - desktop = mkHome [{ home.guifull.enable = true; }]; - }; - } - ); + // flake-utils.lib.eachDefaultSystemPassThrough (system: let + mkHome = extraModules: hm.lib.homeManagerConfiguration { + modules = [ + ./modules/home + { targets.genericLinux.enable = true; } + ] ++ extraModules; + extraSpecialArgs = inputs; + pkgs = builtins.getAttr system stable.legacyPackages; + }; + in { + homeConfigurations = { + default = mkHome [ ]; + desktop = mkHome [{ home.guifull.enable = true; }]; + }; + }); } diff --git a/modules/home/profiles/default.nix b/modules/home/profiles/default.nix index 0f4a47f6..4c658ec6 100644 --- a/modules/home/profiles/default.nix +++ b/modules/home/profiles/default.nix @@ -1,9 +1,6 @@ { lib, ... }: { - imports = [ - ./generic - ./guifull - ]; + imports = [ ./guifull ]; options.home = with lib; { desktop.enable = mkEnableOption "Desktop programs and services"; diff --git a/modules/home/profiles/generic/default.nix b/modules/home/profiles/generic/default.nix deleted file mode 100644 index 1d0c5202..00000000 --- a/modules/home/profiles/generic/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, lib, ... }: -{ - config = lib.mkIf config.targets.genericLinux.enable { - home = { - sessionVariables.PATH = "$HOME/.nix-profile/bin:$PATH"; - }; - }; -}