1
0
Fork 0
forked from Bun/nixos-config

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; outputs = inputs: with inputs;
flake-utils.lib.eachDefaultSystemPassThrough (system:
let let
mkNix = name: channel: channel.lib.nixosSystem { mkNix = name: channel: channel.lib.nixosSystem {
modules = [ (./hosts + "/${name}") ]; modules = [ (./hosts + "/${name}") ];
specialArgs = inputs; specialArgs = inputs;
}; };
mkHome = extraModules: hm.lib.homeManagerConfiguration { in {
modules = [ nixosConfigurations = builtins.mapAttrs (name: channel: mkNix name channel) {
./modules/home
{ targets.genericLinux.enable = true; }
] ++ extraModules;
extraSpecialArgs = inputs;
pkgs = builtins.getAttr system stable.legacyPackages;
};
hostChannels = {
tower = stable; tower = stable;
detritus = stable; detritus = stable;
hidden = stable; hidden = stable;
@ -79,13 +70,21 @@
kitty = stable; kitty = stable;
prophet = 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 = { homeConfigurations = {
default = mkHome [ ]; default = mkHome [ ];
desktop = mkHome [{ home.guifull.enable = true; }]; desktop = mkHome [{ home.guifull.enable = true; }];
}; };
} });
);
} }

View file

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