nixos/lemmy: handle database creation better

This commit is contained in:
NotAShelf 2023-06-19 23:44:17 +03:00 committed by Yt
parent 883ea1e0ba
commit b5fcbad5fb

View File

@ -202,7 +202,7 @@ in
environment = {
LEMMY_CONFIG_LOCATION = "${settingsFormat.generate "config.hjson" cfg.settings}";
LEMMY_DATABASE_URL = mkIf (cfg.database.uri != null) cfg.database.uri;
LEMMY_DATABASE_URL = if cfg.database.uri != null then cfg.database.uri else (mkIf (cfg.database.createLocally) "postgres:///lemmy?host=/run/postgresql&user=lemmy");
};
documentation = [