diff options
author | Brian Leung <leungbk@posteo.net> | 2022-09-16 00:28:29 -0700 |
---|---|---|
committer | Yt <happysalada@proton.me> | 2022-09-21 09:00:52 -0400 |
commit | 3de898f26272c261b4e186bc8744080e22019068 (patch) | |
tree | 8dec04f21dd77d4c80c0959ebd60c0f389384168 /nixos/modules/services/web-apps/lemmy.nix | |
parent | 1d9d8a31bc24594f2782e77e6934a4e8c26efe94 (diff) | |
download | nixlib-3de898f26272c261b4e186bc8744080e22019068.tar nixlib-3de898f26272c261b4e186bc8744080e22019068.tar.gz nixlib-3de898f26272c261b4e186bc8744080e22019068.tar.bz2 nixlib-3de898f26272c261b4e186bc8744080e22019068.tar.lz nixlib-3de898f26272c261b4e186bc8744080e22019068.tar.xz nixlib-3de898f26272c261b4e186bc8744080e22019068.tar.zst nixlib-3de898f26272c261b4e186bc8744080e22019068.zip |
nixos/lemmy: inline localPostgres into database assertion
Co-authored-by: Shahar Dawn Or <mightyiampresence@gmail.com> Co-authored-by: Ctem <c@ctem.me> Co-authored-by: a-kenji <aks.kenji@protonmail.com> Co-authored-by: Brian Leung <leungbk@posteo.net> Co-authored-by: Ilan Joselevich <personal@ilanjoselevich.com>
Diffstat (limited to 'nixos/modules/services/web-apps/lemmy.nix')
-rw-r--r-- | nixos/modules/services/web-apps/lemmy.nix | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/nixos/modules/services/web-apps/lemmy.nix b/nixos/modules/services/web-apps/lemmy.nix index 925156e7c4ab..24ba91df6148 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"; }]; |