From 70cc0d412fc64a0db9d2b2c49f296e2ce628d585 Mon Sep 17 00:00:00 2001 From: Christoph Hrdinka Date: Mon, 3 Jul 2023 17:02:12 +0200 Subject: [PATCH] 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. --- nixos/modules/services/misc/gitea.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix index 5c35cfa177a2..65f8a7ed335b 100644 --- a/nixos/modules/services/misc/gitea.nix +++ b/nixos/modules/services/misc/gitea.nix @@ -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 ];