Implement use for isServer and isMinimal flags; Removes unnecessary home configs for minimal hosts, simplifying them

- Moves komodo symlinks to tempfiles
This commit is contained in:
Chris Toph 2025-06-02 13:15:39 -04:00
parent 19804fe7da
commit f07e5a72e5
11 changed files with 38 additions and 42 deletions

View file

@ -1,3 +0,0 @@
{
# No Special Home
}

View file

@ -1,11 +0,0 @@
{
config,
...
}:
{
home.file = {
Pool.source = config.lib.file.mkOutOfStoreSymlink "/pool";
DockerStorage.source = config.lib.file.mkOutOfStoreSymlink "/mnt/DockerStorage";
};
}

View file

@ -1,3 +0,0 @@
{
# No Special Home
}

View file

@ -1,3 +0,0 @@
{
# No Special Home
}

View file

@ -5,6 +5,8 @@
... ...
}: }:
let let
isServer = hostSpec.isServer or false;
qogir = pkgs.qogir-icon-theme.override { qogir = pkgs.qogir-icon-theme.override {
colorVariants = [ colorVariants = [
"dark" "dark"
@ -14,9 +16,8 @@ let
"ubuntu" "ubuntu"
]; ];
}; };
in in
{ lib.mkIf (!isServer) {
imports = [ imports = [
inputs.stylix.homeManagerModules.stylix inputs.stylix.homeManagerModules.stylix
]; ];

View file

@ -71,32 +71,37 @@ in
}; };
} }
// lib.optionalAttrs (inputs ? "home-manager") { // lib.optionalAttrs (inputs ? "home-manager") {
# Setup root home?
home-manager.users.root = lib.optionalAttrs (!isMinimal) {
home.stateVersion = "24.05"; # Avoid error
};
# Set up home-manager for the configured user # Set up home-manager for the configured user
home-manager = { home-manager = {
extraSpecialArgs = { extraSpecialArgs = {
inherit pkgs inputs; inherit pkgs inputs;
inherit (config) secretsSpec hostSpec; inherit (config) secretsSpec hostSpec;
}; };
users.${username} = lib.optionalAttrs (!isMinimal) { users = {
imports = [ root.home.stateVersion = "24.05"; # Avoid error
( ${username} = {
{ config, ... }: imports = [
import (lib.custom.relativeToRoot "home/users/${username}") { (
inherit { config, ... }:
config import
hostSpec (
inputs if isMinimal then
lib lib.custom.relativeToRoot "home/global/core"
pkgs else
; lib.custom.relativeToRoot "home/users/${username}"
} )
) {
]; inherit
config
hostSpec
inputs
lib
pkgs
;
}
)
];
};
}; };
}; };
} }

View file

@ -45,6 +45,7 @@ in
handle = user.handle; handle = user.handle;
userFullName = user.fullName; userFullName = user.fullName;
isServer = true; isServer = true;
isMinimal = true;
}; };
networking = { networking = {

View file

@ -45,6 +45,7 @@ in
handle = user.handle; handle = user.handle;
userFullName = user.fullName; userFullName = user.fullName;
isServer = true; isServer = true;
isMinimal = true;
}; };
networking = { networking = {

View file

@ -9,4 +9,10 @@
"hosts/global/common/system/pool.nix" "hosts/global/common/system/pool.nix"
]) ])
]; ];
## Easy links, I use this dirs more often in this host
systemd.user.tmpfiles.rules = [
"L+ %h/Pool - - - - /pool"
"L+ %h/DockerStorage - - - - /mnt/DockerStorage"
];
} }

View file

@ -38,6 +38,7 @@ in
handle = user.handle; handle = user.handle;
userFullName = user.fullName; userFullName = user.fullName;
isServer = true; isServer = true;
isMinimal = true;
}; };
networking = { networking = {

View file

@ -46,6 +46,7 @@ in
handle = user.handle; handle = user.handle;
userFullName = user.fullName; userFullName = user.fullName;
isServer = true; isServer = true;
isMinimal = true;
}; };
networking = { networking = {