feat(modules,gitea): update gitea module
This commit is contained in:
@@ -158,7 +158,7 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.gitea-secrets = mkIf (!cfg.useWizard) {
|
systemd.services.gitea-secrets = {
|
||||||
description = "Gitea secret bootstrap helper";
|
description = "Gitea secret bootstrap helper";
|
||||||
script = ''
|
script = ''
|
||||||
if [ ! -s '${cfg.secrets.security.SECRET_KEY}' ]; then
|
if [ ! -s '${cfg.secrets.security.SECRET_KEY}' ]; then
|
||||||
@@ -200,7 +200,7 @@ in {
|
|||||||
++ optionals (cfg.database.type == "mysql") [
|
++ optionals (cfg.database.type == "mysql") [
|
||||||
"mysql.service"
|
"mysql.service"
|
||||||
]
|
]
|
||||||
++ optionals (!cfg.useWizard) [
|
++ [
|
||||||
"gitea-secrets.service"
|
"gitea-secrets.service"
|
||||||
];
|
];
|
||||||
requires =
|
requires =
|
||||||
@@ -210,7 +210,7 @@ in {
|
|||||||
++ optionals (cfg.database.createDatabase && cfg.database.type == "mysql") [
|
++ optionals (cfg.database.createDatabase && cfg.database.type == "mysql") [
|
||||||
"mysql.service"
|
"mysql.service"
|
||||||
]
|
]
|
||||||
++ optionals (!cfg.useWizard) [
|
++ [
|
||||||
"gitea-secrets.service"
|
"gitea-secrets.service"
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ in {
|
|||||||
# https://github.com/NixOS/nixpkgs/blob/20c4598c84a671783f741e02bf05cbfaf4907cff/nixos/modules/services/misc/forgejo.nix#L696
|
# https://github.com/NixOS/nixpkgs/blob/20c4598c84a671783f741e02bf05cbfaf4907cff/nixos/modules/services/misc/forgejo.nix#L696
|
||||||
preStart = ''
|
preStart = ''
|
||||||
# copy custom configuration and generate random secrets if needed
|
# copy custom configuration and generate random secrets if needed
|
||||||
${optionalString (!cfg.useWizard) ''
|
${''
|
||||||
function gitea_setup {
|
function gitea_setup {
|
||||||
config='${cfg.customDir}/conf/app.ini'
|
config='${cfg.customDir}/conf/app.ini'
|
||||||
cp -f '${format.generate "app.ini" cfg.settings}' "$config"
|
cp -f '${format.generate "app.ini" cfg.settings}' "$config"
|
||||||
|
|||||||
Reference in New Issue
Block a user