refactor: schema

This commit is contained in:
2026-05-06 21:57:58 +02:00
parent c01c13aa50
commit 4b6e05212c
27 changed files with 198 additions and 377 deletions
+16 -13
View File
@@ -37,26 +37,35 @@ let
};
mkHost =
machine:
name: machine:
{ pkgs, ... }:
let
account = config.repo.account;
accountHome = account.homeDirectory or "/home/${account.name}";
normalizedMachine = machine // {
inherit name;
displays = machine.displays or { };
hmStateVersion = machine.hmStateVersion or machine.stateVersion;
portable = machine.portable or false;
sshKeys = machine.sshKeys or { };
syncthingId = machine.syncthingId or null;
};
in
{
imports = [
nixosModules.${machine.name}
nixosModules.${name}
];
meta.machine = machine;
facts.machine = normalizedMachine;
networking.hostName = machine.name;
networking.hostName = name;
system.stateVersion = machine.stateVersion;
programs.zsh.enable = true;
users.users.${account.name} = {
isNormalUser = true;
home = account.homeDirectory;
home = accountHome;
extraGroups = [
"wheel"
"networkmanager"
@@ -67,19 +76,13 @@ let
home-manager.users.${account.name} = {
home = {
username = account.name;
homeDirectory = account.homeDirectory;
stateVersion = machine.hmStateVersion;
homeDirectory = accountHome;
stateVersion = normalizedMachine.hmStateVersion;
};
};
};
in
{
options.repo.helpers = lib.mkOption {
type = lib.types.attrsOf lib.types.raw;
internal = true;
readOnly = true;
};
config.repo.helpers = {
inherit
mkCaddyReverseProxy