From 9bb097fec1ca593a5c04f95ed6a0cc9b5c9e2dc5 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Mon, 23 Feb 2026 22:36:46 +0100 Subject: [PATCH] forgejo: add default empty users option --- modules/services/forgejo.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/services/forgejo.nix b/modules/services/forgejo.nix index 36f2d64..daadbdc 100644 --- a/modules/services/forgejo.nix +++ b/modules/services/forgejo.nix @@ -47,13 +47,14 @@ in (lib.mkRemovedOptionModule [ "shb" "forgejo" "adminPassword" ] '' Instead, define an admin user in shb.forgejo.users and give it the same password, like so: - shb.forgejo.users = { - "forgejoadmin" = { - isAdmin = true; - email = "forgejoadmin@example.com"; - password.result = ; - }; + + shb.forgejo.users = { + "forgejoadmin" = { + isAdmin = true; + email = "forgejoadmin@example.com"; + password.result = ; }; + }; '') ]; @@ -233,6 +234,7 @@ in users = mkOption { description = "Users managed declaratively."; + default = { }; type = attrsOf (submodule { options = { isAdmin = mkOption { @@ -245,7 +247,7 @@ in description = '' Email of user. - This is only set when the user is created, changing this later on will have no effect. + This is only set when the user is created, changing this later on will have no effect. ''; type = str; }; @@ -331,7 +333,7 @@ in options = shb.contracts.backup.mkRequester { user = options.services.forgejo.user.value; sourceDirectories = [ - options.services.forgejo.dump.backupDir.value + config.services.forgejo.dump.backupDir ] ++ optionals (cfg.repositoryRoot != null) [ cfg.repositoryRoot