forgejo: add default empty users option

This commit is contained in:
ibizaman 2026-02-23 22:36:46 +01:00
parent 86550e1261
commit 9bb097fec1

View file

@ -47,6 +47,7 @@ in
(lib.mkRemovedOptionModule [ "shb" "forgejo" "adminPassword" ] '' (lib.mkRemovedOptionModule [ "shb" "forgejo" "adminPassword" ] ''
Instead, define an admin user in shb.forgejo.users and give it the same password, like so: Instead, define an admin user in shb.forgejo.users and give it the same password, like so:
shb.forgejo.users = { shb.forgejo.users = {
"forgejoadmin" = { "forgejoadmin" = {
isAdmin = true; isAdmin = true;
@ -233,6 +234,7 @@ in
users = mkOption { users = mkOption {
description = "Users managed declaratively."; description = "Users managed declaratively.";
default = { };
type = attrsOf (submodule { type = attrsOf (submodule {
options = { options = {
isAdmin = mkOption { isAdmin = mkOption {
@ -331,7 +333,7 @@ in
options = shb.contracts.backup.mkRequester { options = shb.contracts.backup.mkRequester {
user = options.services.forgejo.user.value; user = options.services.forgejo.user.value;
sourceDirectories = [ sourceDirectories = [
options.services.forgejo.dump.backupDir.value config.services.forgejo.dump.backupDir
] ]
++ optionals (cfg.repositoryRoot != null) [ ++ optionals (cfg.repositoryRoot != null) [
cfg.repositoryRoot cfg.repositoryRoot