diff --git a/nixos/modules/services/web-apps/lemmy.nix b/nixos/modules/services/web-apps/lemmy.nix index 925156e7c4a..24ba91df614 100644 --- a/nixos/modules/services/web-apps/lemmy.nix +++ b/nixos/modules/services/web-apps/lemmy.nix @@ -71,9 +71,6 @@ in }; config = - let - localPostgres = (cfg.settings.database.host == "localhost" || cfg.settings.database.host == "/run/postgresql"); - in lib.mkIf cfg.enable { services.lemmy.settings = (mapAttrs (name: mkDefault) { @@ -100,7 +97,7 @@ in }; }); - services.postgresql = mkIf localPostgres { + services.postgresql = mkIf cfg.database.createLocally { enable = mkDefault true; }; @@ -141,7 +138,7 @@ in }; assertions = [{ - assertion = cfg.database.createLocally -> localPostgres; + assertion = cfg.database.createLocally -> cfg.settings.database.host == "localhost" || cfg.settings.database.host == "/run/postgresql"; message = "if you want to create the database locally, you need to use a local database"; }];