mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-15 13:37:21 +03:00
mastodon, nixos/mastodon: use the same nodejs package in package and module
This commit is contained in:
parent
ee688534bd
commit
96f0c2c191
@ -450,7 +450,7 @@ in {
|
||||
else { PORT = toString(cfg.streamingPort); }
|
||||
);
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.nodejs-slim}/bin/node streaming";
|
||||
ExecStart = "${cfg.package}/run-streaming.sh";
|
||||
Restart = "always";
|
||||
RestartSec = 20;
|
||||
EnvironmentFile = "/var/lib/mastodon/.secrets_env";
|
||||
|
@ -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; {
|
||||
|
@ -17921,7 +17921,11 @@ in
|
||||
|
||||
mailman-web = with python3.pkgs; toPythonApplication mailman-web;
|
||||
|
||||
mastodon = callPackage ../servers/mastodon { };
|
||||
mastodon = callPackage ../servers/mastodon {
|
||||
# With nodejs v14 the streaming endpoint breaks. Need migrate to uWebSockets.js or similar.
|
||||
# https://github.com/tootsuite/mastodon/issues/15184
|
||||
nodejs-slim = nodejs-slim-12_x;
|
||||
};
|
||||
|
||||
mattermost = callPackage ../servers/mattermost { };
|
||||
matterircd = callPackage ../servers/mattermost/matterircd.nix { };
|
||||
|
Loading…
Reference in New Issue
Block a user