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:
parent
19804fe7da
commit
f07e5a72e5
11 changed files with 38 additions and 42 deletions
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
# No Special Home
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
home.file = {
|
||||
Pool.source = config.lib.file.mkOutOfStoreSymlink "/pool";
|
||||
DockerStorage.source = config.lib.file.mkOutOfStoreSymlink "/mnt/DockerStorage";
|
||||
};
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
# No Special Home
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
# No Special Home
|
||||
}
|
|
@ -5,6 +5,8 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
isServer = hostSpec.isServer or false;
|
||||
|
||||
qogir = pkgs.qogir-icon-theme.override {
|
||||
colorVariants = [
|
||||
"dark"
|
||||
|
@ -14,9 +16,8 @@ let
|
|||
"ubuntu"
|
||||
];
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
lib.mkIf (!isServer) {
|
||||
imports = [
|
||||
inputs.stylix.homeManagerModules.stylix
|
||||
];
|
||||
|
|
|
@ -71,22 +71,26 @@ in
|
|||
};
|
||||
}
|
||||
// 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
|
||||
home-manager = {
|
||||
extraSpecialArgs = {
|
||||
inherit pkgs inputs;
|
||||
inherit (config) secretsSpec hostSpec;
|
||||
};
|
||||
users.${username} = lib.optionalAttrs (!isMinimal) {
|
||||
users = {
|
||||
root.home.stateVersion = "24.05"; # Avoid error
|
||||
${username} = {
|
||||
imports = [
|
||||
(
|
||||
{ config, ... }:
|
||||
import (lib.custom.relativeToRoot "home/users/${username}") {
|
||||
import
|
||||
(
|
||||
if isMinimal then
|
||||
lib.custom.relativeToRoot "home/global/core"
|
||||
else
|
||||
lib.custom.relativeToRoot "home/users/${username}"
|
||||
)
|
||||
{
|
||||
inherit
|
||||
config
|
||||
hostSpec
|
||||
|
@ -99,4 +103,5 @@ in
|
|||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ in
|
|||
handle = user.handle;
|
||||
userFullName = user.fullName;
|
||||
isServer = true;
|
||||
isMinimal = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
|
|
|
@ -45,6 +45,7 @@ in
|
|||
handle = user.handle;
|
||||
userFullName = user.fullName;
|
||||
isServer = true;
|
||||
isMinimal = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
|
|
|
@ -9,4 +9,10 @@
|
|||
"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"
|
||||
];
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ in
|
|||
handle = user.handle;
|
||||
userFullName = user.fullName;
|
||||
isServer = true;
|
||||
isMinimal = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
|
|
|
@ -46,6 +46,7 @@ in
|
|||
handle = user.handle;
|
||||
userFullName = user.fullName;
|
||||
isServer = true;
|
||||
isMinimal = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
|
|
Loading…
Add table
Reference in a new issue