about summary refs log tree commit diff
path: root/pkgs/servers/mastodon
diff options
context:
space:
mode:
authorVladimir Pouzanov <farcaller@gmail.com>2023-11-19 18:35:55 +0000
committerVladimir Pouzanov <farcaller@gmail.com>2023-11-20 12:26:11 +0000
commit1d47cfbf65c57cfd03db57b48d7b1386a74a0286 (patch)
treefb87612bc4e37140cc000bc501144f843f395a35 /pkgs/servers/mastodon
parent2cc73b2b7cabeb0639e55e39b24b572adb8298ed (diff)
mastodon: easier build patching
Diffstat (limited to 'pkgs/servers/mastodon')
-rw-r--r--pkgs/servers/mastodon/default.nix3
-rw-r--r--pkgs/servers/mastodon/source.nix4
-rwxr-xr-xpkgs/servers/mastodon/update.sh4
3 files changed, 6 insertions, 5 deletions
diff --git a/pkgs/servers/mastodon/default.nix b/pkgs/servers/mastodon/default.nix
index 7b20fe7038f94..0fa099881d967 100644
--- a/pkgs/servers/mastodon/default.nix
+++ b/pkgs/servers/mastodon/default.nix
@@ -6,8 +6,9 @@
   # Allow building a fork or custom version of Mastodon:
 , pname ? "mastodon"
 , version ? srcOverride.version
+, patches ? []
   # src is a package
-, srcOverride ? callPackage ./source.nix {}
+, srcOverride ? callPackage ./source.nix { inherit patches; }
 , gemset ? ./. + "/gemset.nix"
 , yarnHash ? srcOverride.yarnHash
 }:
diff --git a/pkgs/servers/mastodon/source.nix b/pkgs/servers/mastodon/source.nix
index fd1101238a319..4f39e350a0f03 100644
--- a/pkgs/servers/mastodon/source.nix
+++ b/pkgs/servers/mastodon/source.nix
@@ -1,5 +1,5 @@
 # This file was generated by pkgs.mastodon.updateScript.
-{ fetchFromGitHub, applyPatches }:
+{ fetchFromGitHub, applyPatches, patches ? [] }:
 let
   version = "4.2.1";
 in
@@ -11,7 +11,7 @@ in
       rev = "v${version}";
       hash = "sha256-SM9WdD+xpxo+gfBft9DARV6QjwNbF2Y9McVrrdDT3fw=";
     };
-    patches = [];
+    patches = patches ++ [];
   }) // {
   inherit version;
   yarnHash = "sha256-qoLesubmSvRsXhKwMEWHHXcpcqRszqcdZgHQqnTpNPE=";
diff --git a/pkgs/servers/mastodon/update.sh b/pkgs/servers/mastodon/update.sh
index ab430315858e3..8e8350431e211 100755
--- a/pkgs/servers/mastodon/update.sh
+++ b/pkgs/servers/mastodon/update.sh
@@ -82,7 +82,7 @@ HASH=$(echo "$JSON" | jq -r .hash)
 
 cat > source.nix << EOF
 # This file was generated by pkgs.mastodon.updateScript.
-{ fetchFromGitHub, applyPatches }:
+{ fetchFromGitHub, applyPatches, patches ? [] }:
 let
   version = "$VERSION";
 in
@@ -94,7 +94,7 @@ in
       rev = "v\${version}";
       hash = "$HASH";
     };
-    patches = [$PATCHES];
+    patches = patches ++ [$PATCHES];
   }) // {
   inherit version;
   yarnHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";