From 598f9bb25679dbd5c70374c1ad5bfe246ec88e68 Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Fri, 6 Feb 2026 21:45:40 +0100 Subject: [PATCH] Try out the better local config declaration. --- .../modules/secrets/secrets.example.nix | 3 +-- nix-system-configs/modules/system/forgejo.nix | 17 +++++++++++++---- nix-system-configs/modules/system/traefik.nix | 17 +++++++++++++---- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/nix-system-configs/modules/secrets/secrets.example.nix b/nix-system-configs/modules/secrets/secrets.example.nix index f02c413..40cf2d3 100644 --- a/nix-system-configs/modules/secrets/secrets.example.nix +++ b/nix-system-configs/modules/secrets/secrets.example.nix @@ -4,8 +4,7 @@ lib, ... }: { - - # TODO Figure out a better way to manage secrets. + # TODO Figure out a better way to manage secrets. local.secrets = { gitUserName = "Your Name"; gitUserEmail = "you@example.com"; diff --git a/nix-system-configs/modules/system/forgejo.nix b/nix-system-configs/modules/system/forgejo.nix index 1bf9bf0..69a53de 100644 --- a/nix-system-configs/modules/system/forgejo.nix +++ b/nix-system-configs/modules/system/forgejo.nix @@ -8,10 +8,19 @@ cfg = config.services.forgejo; srv = cfg.settings.server; in { - local.hostname = "forgejoprg"; - local.username = "forgejoprg"; - local.userDescription = "Forgejo Admin"; - local.address = "10.1.1.4"; + options.local = { + hostname = lib.mkOption {type = lib.types.str;}; + username = lib.mkOption {type = lib.types.str;}; + userDescription = lib.mkOption {type = lib.types.str;}; + address = lib.mkOption {type = lib.types.str;}; + }; + + config = { + local.hostname = "forgejoprg"; + local.username = "forgejoprg"; + local.userDescription = "Forgejo Admin"; + local.address = "10.1.1.4"; + }; # Enable Fedgejo service services.nginx = { diff --git a/nix-system-configs/modules/system/traefik.nix b/nix-system-configs/modules/system/traefik.nix index 3ea3feb..56644c9 100644 --- a/nix-system-configs/modules/system/traefik.nix +++ b/nix-system-configs/modules/system/traefik.nix @@ -4,10 +4,19 @@ lib, ... }: { - local.hostname = "nixos-traefik"; - local.username = "traefikprg"; - local.userDescription = "NixOS PRG Traefik Service"; - local.address = "10.1.1.250"; + options.local = { + hostname = lib.mkOption {type = lib.types.str;}; + username = lib.mkOption {type = lib.types.str;}; + userDescription = lib.mkOption {type = lib.types.str;}; + address = lib.mkOption {type = lib.types.str;}; + }; + + config = { + local.hostname = "nixos-traefik"; + local.username = "traefikprg"; + local.userDescription = "NixOS PRG Traefik Service"; + local.address = "10.1.1.250"; + }; services.traefik = { enable = true;