Simplify flake readability, move NixOS configs outside of flake-utils

This commit is contained in:
Bun 2025-05-31 17:47:49 -04:00
parent a4d6a7663c
commit 215ad6b1a7
3 changed files with 33 additions and 45 deletions

View file

@ -52,22 +52,13 @@
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;
};
hostChannels = {
in {
nixosConfigurations = builtins.mapAttrs (name: channel: mkNix name channel) {
tower = stable;
detritus = stable;
hidden = stable;
@ -79,13 +70,21 @@
kitty = stable;
prophet = stable;
};
in {
nixosConfigurations = builtins.mapAttrs (name: channel: mkNix name channel) hostChannels;
}
// 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; }];
};
}
);
});
}

View file

@ -1,9 +1,6 @@
{ lib, ... }:
{
imports = [
./generic
./guifull
];
imports = [ ./guifull ];
options.home = with lib; {
desktop.enable = mkEnableOption "Desktop programs and services";

View file

@ -1,8 +0,0 @@
{ config, lib, ... }:
{
config = lib.mkIf config.targets.genericLinux.enable {
home = {
sessionVariables.PATH = "$HOME/.nix-profile/bin:$PATH";
};
};
}