about summary refs log tree commit diff
path: root/pkgs/servers/mastodon
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2023-07-02 23:23:20 +0200
committerSandro Jäckel <sandro.jaeckel@gmail.com>2023-07-03 00:37:30 +0200
commit74ca55400e6c559ce2452bb39b0b3c9e83d3abb1 (patch)
treec08d50692fc15a2b7287925de4aa5a73756e24ed /pkgs/servers/mastodon
parentc4ca94c154fffb08465ffd6664c9a51290b60895 (diff)
mastodon: add runHooks
This makes constructing overrides easier
Diffstat (limited to 'pkgs/servers/mastodon')
-rw-r--r--pkgs/servers/mastodon/default.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkgs/servers/mastodon/default.nix b/pkgs/servers/mastodon/default.nix
index 8f34d284df217..422b3e2be5c5b 100644
--- a/pkgs/servers/mastodon/default.nix
+++ b/pkgs/servers/mastodon/default.nix
@@ -52,6 +52,8 @@ stdenv.mkDerivation rec {
     NODE_ENV = "production";
 
     buildPhase = ''
+      runHook preBuild
+
       export HOME=$PWD
       # This option is needed for openssl-3 compatibility
       # Otherwise we encounter this upstream issue: https://github.com/mastodon/mastodon/issues/17924
@@ -79,13 +81,19 @@ stdenv.mkDerivation rec {
       brotli --best --keep ~/public/packs/report.html
       find ~/public/assets -type f -regextype posix-extended -iregex '.*\.(css|js|json|html)' \
         -exec brotli --best --keep {} ';'
+
+      runHook postBuild
     '';
 
     installPhase = ''
+      runHook preInstall
+
       mkdir -p $out/public
       cp -r node_modules $out/node_modules
       cp -r public/assets $out/public
       cp -r public/packs $out/public
+
+      runHook postInstall
     '';
   };
 
@@ -93,6 +101,8 @@ stdenv.mkDerivation rec {
   buildInputs = [ mastodonGems nodejs-slim ];
 
   buildPhase = ''
+    runHook preBuild
+
     ln -s $mastodonModules/node_modules node_modules
     ln -s $mastodonModules/public/assets public/assets
     ln -s $mastodonModules/public/packs public/packs
@@ -125,6 +135,8 @@ stdenv.mkDerivation rec {
     rm -rf log
     ln -s /var/log/mastodon log
     ln -s /tmp tmp
+
+    runHook postBuild
   '';
 
   installPhase = let
@@ -133,9 +145,13 @@ stdenv.mkDerivation rec {
       ${nodejs-slim}/bin/node ./streaming
     '';
   in ''
+    runHook preInstall
+
     mkdir -p $out
     cp -r * $out/
     ln -s ${run-streaming} $out/run-streaming.sh
+
+    runHook postInstall
   '';
 
   passthru = {