forgejo: add default empty users option
This commit is contained in:
parent
86550e1261
commit
9bb097fec1
1 changed files with 10 additions and 8 deletions
|
|
@ -47,13 +47,14 @@ 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 = {
|
|
||||||
"forgejoadmin" = {
|
shb.forgejo.users = {
|
||||||
isAdmin = true;
|
"forgejoadmin" = {
|
||||||
email = "forgejoadmin@example.com";
|
isAdmin = true;
|
||||||
password.result = <path/to/password>;
|
email = "forgejoadmin@example.com";
|
||||||
};
|
password.result = <path/to/password>;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
@ -245,7 +247,7 @@ in
|
||||||
description = ''
|
description = ''
|
||||||
Email of user.
|
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;
|
type = str;
|
||||||
};
|
};
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue