Refactors host config file structure

• Migrates configuration files from 'common' to 'global'
• Updates import paths across modules
• Removes outdated macOS configuration
• Adds user configuration files WIP
This commit is contained in:
Chris Toph 2025-05-08 17:06:03 -04:00
parent ae77147d86
commit 704a630a33
44 changed files with 122 additions and 67 deletions

View file

@ -1,22 +0,0 @@
{
inputs,
pkgs,
...
}:
{
imports = [
inputs.nixtheplanet.nixosModules.macos-ventura
];
services.macos-ventura = {
enable = true;
package = pkgs.makeDarwinImage { diskSizeBytes = 80000000000; };
openFirewall = true;
vncListenAddr = "0.0.0.0";
autoStart = false;
extraQemuFlags = [
"-spice"
"port=5930,addr=127.0.0.1,disable-ticketing"
];
};
}

View file

@ -27,11 +27,11 @@ in
(map lib.custom.relativeToRoot [
## Required Configs ##
"hosts/common/core"
"hosts/global/core"
## Optional Configs ##
"hosts/common/optional/acme"
"hosts/common/optional/docker.nix"
"hosts/global/common/acme"
"hosts/global/common/docker.nix"
## Host user ##
"hosts/users/${username}" # Not the best solution but I always have one user so ¯\_(ツ)_/¯

View file

@ -10,7 +10,7 @@ in
{
imports = lib.flatten [
(map lib.custom.relativeToRoot [
"hosts/common/optional/system/lxc.nix"
"hosts/global/common/system/lxc.nix"
])
];

View file

@ -26,11 +26,11 @@ in
(map lib.custom.relativeToRoot [
## Required Configs ##
"hosts/common/core"
"hosts/global/core"
## Optional Configs ##
"hosts/common/optional/acme"
"hosts/common/optional/docker.nix"
"hosts/global/common/acme"
"hosts/global/common/docker.nix"
## Host User ##
"hosts/users/${username}" # # Not the best solution but I always have one user so ¯\_(ツ)_/¯

View file

@ -5,8 +5,8 @@
{
imports = lib.flatten [
(map lib.custom.relativeToRoot [
"hosts/common/optional/system/lxc.nix"
"hosts/common/optional/system/pool.nix"
"hosts/global/common/system/lxc.nix"
"hosts/global/common/system/pool.nix"
])
];
}

View file

@ -25,7 +25,7 @@ in
(map lib.custom.relativeToRoot [
## Required Configs ##
"hosts/common/core"
"hosts/global/core"
## Proxy Specific ##
"hosts/users/${username}" # # Not the best solution but I always have one user so ¯\_(ツ)_/¯

View file

@ -5,8 +5,8 @@
{
imports = lib.flatten [
(map lib.custom.relativeToRoot [
"hosts/common/optional/system/lxc.nix"
"hosts/common/optional/system/pool.nix"
"hosts/global/common/system/lxc.nix"
"hosts/global/common/system/pool.nix"
])
];
}

View file

@ -25,7 +25,7 @@ in
(map lib.custom.relativeToRoot [
## Required Configs ##
"hosts/common/core"
"hosts/global/core"
## Optional Configs ##

View file

@ -5,8 +5,8 @@
{
imports = lib.flatten [
(map lib.custom.relativeToRoot [
"hosts/common/optional/system/lxc.nix"
"hosts/common/optional/system/pool.nix"
"hosts/global/common/system/lxc.nix"
"hosts/global/common/system/pool.nix"
])
];
}

View file

@ -27,11 +27,11 @@ in
(map lib.custom.relativeToRoot [
## Required Configs ##
"hosts/common/core"
"hosts/global/core"
## Optional Configs ##
"hosts/common/optional/acme"
"hosts/common/optional/docker.nix"
"hosts/global/common/acme"
"hosts/global/common/docker.nix"
## Proxy User ##
"hosts/users/${username}" # # Not the best solution but I always have one user so ¯\_(ツ)_/¯

View file

@ -5,8 +5,8 @@
{
imports = lib.flatten [
(map lib.custom.relativeToRoot [
"hosts/common/optional/system/lxc.nix"
"hosts/common/optional/system/pool.nix"
"hosts/global/common/system/lxc.nix"
"hosts/global/common/system/pool.nix"
])
];
}

View file

@ -27,21 +27,21 @@ in
(map lib.custom.relativeToRoot [
## Required Configs ##
"hosts/common/core"
"hosts/global/core"
## Optional Configs ##
"hosts/common/optional/audio.nix" # pipewire and cli controls
"hosts/common/optional/adb.nix" # android tools
"hosts/common/optional/bluetooth.nix"
"hosts/common/optional/ddcutil.nix" # ddcutil for monitor controls
"hosts/common/optional/gaming.nix" # steam, gamescope, gamemode, and related hardware
# "hosts/common/optional/gnome.nix" # desktop
"hosts/common/optional/hyprland" # desktop
"hosts/common/optional/libvirt.nix" # vm tools
"hosts/common/optional/nvtop.nix" # GPU monitor (not available in home-manager)
"hosts/common/optional/plymouth.nix" # fancy boot screen
"hosts/common/optional/vial.nix" # KB setup
# "hosts/common/optional/ventura.nix" # macos vm
"hosts/global/common/audio.nix" # pipewire and cli controls
"hosts/global/common/adb.nix" # android tools
"hosts/global/common/bluetooth.nix"
"hosts/global/common/ddcutil.nix" # ddcutil for monitor controls
"hosts/global/common/gaming.nix" # steam, gamescope, gamemode, and related hardware
# "hosts/global/common/gnome.nix" # desktop
"hosts/global/common/hyprland" # desktop
"hosts/global/common/libvirt.nix" # vm tools
"hosts/global/common/nvtop.nix" # GPU monitor (not available in home-manager)
"hosts/global/common/plymouth.nix" # fancy boot screen
"hosts/global/common/vial.nix" # KB setup
# "hosts/global/common/ventura.nix" # macos vm
## Misc Inputs ##

View file

@ -14,7 +14,7 @@
imports = lib.flatten [
(modulesPath + "/installer/scan/not-detected.nix")
(map lib.custom.relativeToRoot [
"hosts/common/optional/system/pool.nix"
"hosts/global/common/system/pool.nix"
])
];

View file

@ -24,15 +24,15 @@ in
(map lib.custom.relativeToRoot [
## Required Configs ##
"hosts/common/core"
"hosts/global/core"
## Optional Configs ##
"hosts/common/optional/audio.nix" # pipewire and cli controls
# "hosts/common/optional/gaming.nix" # steam, gamescope, gamemode, and related hardware
# "hosts/common/optional/gnome.nix" # desktop
"hosts/common/optional/hyprland" # desktop
# "hosts/common/optional/nvtop.nix" # GPU monitor (not available in home-manager)
# "hosts/common/optional/plymouth.nix" # fancy boot screen
"hosts/global/common/audio.nix" # pipewire and cli controls
# "hosts/global/common/gaming.nix" # steam, gamescope, gamemode, and related hardware
# "hosts/global/common/gnome.nix" # desktop
"hosts/global/common/hyprland" # desktop
# "hosts/global/common/nvtop.nix" # GPU monitor (not available in home-manager)
# "hosts/global/common/plymouth.nix" # fancy boot screen
## Misc Inputs ##

View file

@ -12,7 +12,7 @@ in
imports = lib.flatten [
(modulesPath + "/profiles/qemu-guest.nix")
(map lib.custom.relativeToRoot [
"hosts/common/optional/system/pool.nix"
"hosts/global/common/system/pool.nix"
])
];

10
hosts/readme.md Normal file
View file

@ -0,0 +1,10 @@
# TODO:
- I dont like the current system for hosts importing their main user
- I could rework hostSpecs so its imported since flake and manage it like that?
- or just rework the users/default and the hosts/core to just work different...
- Fix up how DEs are configured, its not modular at all rn, i need to be able to select the DE from hostSpec and it should be able to change config per user
- decouple /pool from places its not needed, or should be optional
- some users should not have access to pool or just cant access it cuz not local
- ssh keys are not setup per user
- should probably fix

View file

@ -0,0 +1,23 @@
{ config, ... }:
let
hostSpec = config.hostSpec;
in
{
users.groups = {
ryot = {
gid = 1004;
members = [ "${hostSpec.username}" ];
};
};
# Set a temp password for use by minimal builds like installer and iso
users.users.${hostSpec.username} = {
isNormalUser = true;
hashedPassword = hostSpec.hashedPassword;
group = "ryot";
extraGroups = [
"wheel"
];
};
}

View file

@ -0,0 +1,23 @@
{ config, ... }:
let
hostSpec = config.hostSpec;
in
{
users.groups = {
ryot = {
gid = 1004;
members = [ "${hostSpec.username}" ];
};
};
# Set a temp password for use by minimal builds like installer and iso
users.users.${hostSpec.username} = {
isNormalUser = true;
hashedPassword = hostSpec.hashedPassword;
group = "ryot";
extraGroups = [
"wheel"
];
};
}

View file

@ -0,0 +1,23 @@
{ config, ... }:
let
hostSpec = config.hostSpec;
in
{
users.groups = {
ryot = {
gid = 1004;
members = [ "${hostSpec.username}" ];
};
};
# Set a temp password for use by minimal builds like installer and iso
users.users.${hostSpec.username} = {
isNormalUser = true;
hashedPassword = hostSpec.hashedPassword;
group = "ryot";
extraGroups = [
"wheel"
];
};
}

View file

@ -16,12 +16,11 @@ in
users.users.${username} = {
name = hostSpec.username;
shell = _shell;
# These get placed into /etc/ssh/authorized_keys.d/<name> on nixos
openssh.authorizedKeys.keys = pubKeys;
};
# Create ssh sockets directory for controlpaths when homemanager not loaded (i.e. isMinimal)
# Create ssh directory when homemanager is not loaded
systemd.tmpfiles.rules =
let
user = config.users.users.${username}.name;
@ -31,7 +30,6 @@ in
"d ${homeDir}/.ssh 0750 ${user} ${group} -"
];
# No matter what environment we are in we want these tools
programs.fish.enable = true;
}
# Import the user's personal/home configurations, unless the environment is minimal