Local config hell.

This commit is contained in:
Root User 2026-02-06 22:02:53 +01:00
parent 9e349b7164
commit 6e399b829a
Signed by: root
GPG key ID: 087F0A95E5766D72
2 changed files with 194 additions and 145 deletions

View file

@ -8,6 +8,30 @@
cfg = config.services.forgejo; cfg = config.services.forgejo;
srv = cfg.settings.server; srv = cfg.settings.server;
in { in {
options.local = {
hostname = lib.mkOption {
type = lib.types.str;
default = "nixos-default";
description = "System hostname";
};
username = lib.mkOption {
type = lib.types.str;
default = "user";
description = "Primary user username";
};
userDescription = lib.mkOption {
type = lib.types.str;
default = "NixOS User";
description = "Primary user description";
};
address = lib.mkOption {
type = lib.types.str;
default = "10.1.1.100";
description = "Static IP address";
};
};
config = {
local.hostname = "forgejoprg"; local.hostname = "forgejoprg";
local.username = "forgejoprg"; local.username = "forgejoprg";
local.userDescription = "Forgejo Admin"; local.userDescription = "Forgejo Admin";
@ -83,4 +107,5 @@ in {
]; ];
system.stateVersion = "25.11"; system.stateVersion = "25.11";
};
} }

View file

@ -4,12 +4,35 @@
lib, lib,
... ...
}: { }: {
options.local = {
hostname = lib.mkOption {
type = lib.types.str;
default = "nixos-default";
description = "System hostname";
};
username = lib.mkOption {
type = lib.types.str;
default = "user";
description = "Primary user username";
};
userDescription = lib.mkOption {
type = lib.types.str;
default = "NixOS User";
description = "Primary user description";
};
address = lib.mkOption {
type = lib.types.str;
default = "10.1.1.100";
description = "Static IP address";
};
};
config = {
local.hostname = "nixos-traefik"; local.hostname = "nixos-traefik";
local.username = "traefikprg"; local.username = "traefikprg";
local.userDescription = "NixOS PRG Traefik Service"; local.userDescription = "NixOS PRG Traefik Service";
local.address = "10.1.1.250"; local.address = "10.1.1.250";
services.traefik = { services.traefik = {
enable = true; enable = true;
group = "acme"; group = "acme";
@ -99,4 +122,5 @@
]; ];
system.stateVersion = "25.11"; system.stateVersion = "25.11";
};
} }