ctucx.git: nixfiles

ctucx' nixfiles

commit c71d1208a813a0e60e0390ffc267a80eadd9db42
parent 9eea0030bfadb32aae2ba250c3abc886ed928d9d
Author: Leah (ctucx) <git@ctu.cx>
Date: Sat, 16 Nov 2024 13:39:06 +0100

pkgs: remove pleroma-patch (as it wasn't used in a while and probably doesn't work anymore)
2 files changed, 0 insertions(+), 76 deletions(-)
D
pkgs/0001-PATCH-Separate-webfinger-domain-from-host-domain.patch
|
70
----------------------------------------------------------------------
M
pkgs/overlay.nix
|
6
------
diff --git a/pkgs/0001-PATCH-Separate-webfinger-domain-from-host-domain.patch b/pkgs/0001-PATCH-Separate-webfinger-domain-from-host-domain.patch
@@ -1,70 +0,0 @@
-From 2a57ef2f0aaaec3bc2d8061368d23f02bbd09452 Mon Sep 17 00:00:00 2001
-From: "Leah (ctucx)" <leah@ctu.cx>
-Date: Wed, 3 Mar 2021 19:19:59 +0100
-Subject: [PATCH] Separate webfinger domain from host domain
-
----
- lib/pleroma/web/web_finger.ex | 27 ++++++++++++++++++++++++---
- 1 file changed, 24 insertions(+), 3 deletions(-)
-
-diff --git a/lib/pleroma/web/web_finger.ex b/lib/pleroma/web/web_finger.ex
-index 15002b2..124367d 100644
---- a/lib/pleroma/web/web_finger.ex
-+++ b/lib/pleroma/web/web_finger.ex
-@@ -31,8 +31,15 @@ def host_meta do
-   end
-
-   def webfinger(resource, fmt) when fmt in ["XML", "JSON"] do
-+    domain = Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain]
-     host = Pleroma.Web.Endpoint.host()
--    regex = ~r/(acct:)?(?<username>[a-z0-9A-Z_\.-]+)@#{host}/
-+
-+    regex =
-+      if domain do
-+        ~r/(acct:)?(?<username>[a-z0-9A-Z_\.-]+)@(#{host}|#{domain})/
-+      else
-+        ~r/(acct:)?(?<username>[a-z0-9A-Z_\.-]+)@#{host}/
-+      end
-
-     with %{"username" => username} <- Regex.named_captures(regex, resource),
-          %User{} = user <- User.get_cached_by_nickname(username) do
-@@ -65,8 +72,15 @@ defp gather_aliases(%User{} = user) do
-   def represent_user(user, "JSON") do
-     {:ok, user} = User.ensure_keys_present(user)
-
-+    host =
-+      if Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain] do
-+        Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain]
-+      else
-+        Pleroma.Web.Endpoint.host()
-+      end
-+
-     %{
--      "subject" => "acct:#{user.nickname}@#{Pleroma.Web.Endpoint.host()}",
-+      "subject" => "acct:#{user.nickname}@#{host}",
-       "aliases" => gather_aliases(user),
-       "links" => gather_links(user)
-     }
-@@ -84,11 +98,18 @@ def represent_user(user, "XML") do
-       gather_links(user)
-       |> Enum.map(fn link -> {:Link, link} end)
-
-+    host =
-+      if Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain] do
-+        Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain]
-+      else
-+        Pleroma.Web.Endpoint.host()
-+      end
-+
-     {
-       :XRD,
-       %{xmlns: "http://docs.oasis-open.org/ns/xri/xrd-1.0"},
-       [
--        {:Subject, "acct:#{user.nickname}@#{Pleroma.Web.Endpoint.host()}"}
-+        {:Subject, "acct:#{user.nickname}@#{host}"}
-       ] ++ aliases ++ links
-     }
-     |> XmlBuilder.to_doc()
---
-2.30.1
-
diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix
@@ -4,12 +4,6 @@ final: prev:
 
   writePythonScriptBin     = (final.callPackage ./writePythonScriptBin.nix {}).writePythonScriptBin;
 
-  pleroma                  = prev.pleroma.overrideAttrs (old: {
-    patches = [
-     ./0001-PATCH-Separate-webfinger-domain-from-host-domain.patch
-    ];
-  });
-
   adwaita-colors-icon-theme = final.callPackage ./adwaita-colors.nix {};
 
   phockup                  = final.callPackage ./phockup.nix {};