mastodon, nixos/mastodon: use the same nodejs package in package and module

This commit is contained in:
Izorkin
2021-02-16 17:57:31 +01:00
committed by erictapen
parent ee688534bd
commit 96f0c2c191
3 changed files with 16 additions and 4 deletions
+10 -2
View File
@@ -1,5 +1,5 @@
{ lib, stdenv, nodejs-slim, mkYarnPackage, fetchFromGitHub, bundlerEnv
, yarn, callPackage, imagemagick, ffmpeg, file, ruby_2_7
, yarn, callPackage, imagemagick, ffmpeg, file, ruby_2_7, writeShellScript
# Allow building a fork or custom version of Mastodon:
, pname ? "mastodon"
@@ -96,10 +96,18 @@ stdenv.mkDerivation rec {
ln -s /var/log/mastodon log
ln -s /tmp tmp
'';
propagatedBuildInputs = [ imagemagick ffmpeg file mastodon-gems.wrappedRuby ];
installPhase = ''
installPhase = let
run-streaming = writeShellScript "run-streaming.sh" ''
# NixOS helper script to consistently use the same NodeJS version the package was built with.
${nodejs-slim}/bin/node ./streaming
'';
in ''
mkdir -p $out
cp -r * $out/
ln -s ${run-streaming} $out/run-streaming.sh
'';
meta = with lib; {