From 6460e459de8a8dc4a816319ed971861a57d8657c Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Wed, 13 Sep 2017 01:12:26 +0100 Subject: [PATCH] nixos/gogs: Fix module when no passwords provided If neither database.password or database.passwordFile were provided, it would try and fail to coerce null to a string. This fixes the situation where there is no password for the database. Resolves #27950 --- nixos/modules/services/misc/gogs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/gogs.nix b/nixos/modules/services/misc/gogs.nix index ad2e36d04d5..d6e827a53fd 100644 --- a/nixos/modules/services/misc/gogs.nix +++ b/nixos/modules/services/misc/gogs.nix @@ -257,7 +257,7 @@ in in the Nix store. Use database.passwordFile instead.''; # Create database passwordFile default when password is configured. - services.gogs.database.passwordFile = mkIf (cfg.database.password != "") + services.gogs.database.passwordFile = (mkDefault (toString (pkgs.writeTextFile { name = "gogs-database-password"; text = cfg.database.password;