nixos/gitea: only require databases if createDatabase is set
Currently the database service (mysql/postgresql) is required by the gitea service. If none of them exists on the same machine as gitea it will refuse to start. With this change it is only required if createDatabase was set to true.
This commit is contained in:
@@ -499,7 +499,7 @@ in
|
||||
systemd.services.gitea = {
|
||||
description = "gitea";
|
||||
after = [ "network.target" ] ++ optional usePostgresql "postgresql.service" ++ optional useMysql "mysql.service";
|
||||
requires = optional usePostgresql "postgresql.service" ++ optional useMysql "mysql.service";
|
||||
requires = optional (cfg.database.createDatabase && usePostgresql) "postgresql.service" ++ optional (cfg.database.createDatabase && useMysql) "mysql.service";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
path = [ cfg.package pkgs.git pkgs.gnupg ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user