about summary refs log tree commit diff
path: root/nixos/modules/services/web-apps/lemmy.nix
diff options
context:
space:
mode:
authorCharles Hall <charles@computer.surgery>2023-06-15 08:26:40 -0700
committerYt <happysalada@tuta.io>2023-06-16 05:59:32 -0400
commit370f3e488352e02ffd797218c74c65ea529c3ca5 (patch)
tree8be8d8ea3ee22d99d7fcbc18d9f81efadda67973 /nixos/modules/services/web-apps/lemmy.nix
parenta056d3567cfa95b732d13a34347ae8babc3deb94 (diff)
downloadnixlib-370f3e488352e02ffd797218c74c65ea529c3ca5.tar
nixlib-370f3e488352e02ffd797218c74c65ea529c3ca5.tar.gz
nixlib-370f3e488352e02ffd797218c74c65ea529c3ca5.tar.bz2
nixlib-370f3e488352e02ffd797218c74c65ea529c3ca5.tar.lz
nixlib-370f3e488352e02ffd797218c74c65ea529c3ca5.tar.xz
nixlib-370f3e488352e02ffd797218c74c65ea529c3ca5.tar.zst
nixlib-370f3e488352e02ffd797218c74c65ea529c3ca5.zip
nixos/lemmy: remove option removed upstream
Diffstat (limited to 'nixos/modules/services/web-apps/lemmy.nix')
-rw-r--r--nixos/modules/services/web-apps/lemmy.nix22
1 files changed, 10 insertions, 12 deletions
diff --git a/nixos/modules/services/web-apps/lemmy.nix b/nixos/modules/services/web-apps/lemmy.nix
index 844855d8286c..1580716b1c4e 100644
--- a/nixos/modules/services/web-apps/lemmy.nix
+++ b/nixos/modules/services/web-apps/lemmy.nix
@@ -62,10 +62,6 @@ in
           description = lib.mdDoc "Port where lemmy should listen for incoming requests.";
         };
 
-        options.federation = {
-          enabled = (mkEnableOption (lib.mdDoc "activitypub federation")) // { visible = false; };
-        };
-
         options.captcha = {
           enabled = mkOption {
             type = types.bool;
@@ -85,10 +81,6 @@ in
 
   config =
     lib.mkIf cfg.enable {
-      warnings = lib.optional (cfg.settings.federation.enabled) ''
-        This option was removed in 0.17.0 and no longer has any effect.
-      '';
-
       services.lemmy.settings = (mapAttrs (name: mkDefault)
         {
           bind = "127.0.0.1";
@@ -194,10 +186,16 @@ in
         };
       };
 
-      assertions = [{
-        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";
-      }];
+      assertions = [
+        {
+          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";
+        }
+        {
+          assertion = (!(hasAttrByPath ["federation"] cfg.settings)) && (!(hasAttrByPath ["federation" "enabled"] cfg.settings));
+          message = "`services.lemmy.settings.federation` was removed in 0.17.0 and no longer has any effect";
+        }
+      ];
 
       systemd.services.lemmy = {
         description = "Lemmy server";