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); }
|
else { PORT = toString(cfg.streamingPort); }
|
||||||
);
|
);
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.nodejs-slim}/bin/node streaming";
|
ExecStart = "${cfg.package}/run-streaming.sh";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
RestartSec = 20;
|
RestartSec = 20;
|
||||||
EnvironmentFile = "/var/lib/mastodon/.secrets_env";
|
EnvironmentFile = "/var/lib/mastodon/.secrets_env";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ lib, stdenv, nodejs-slim, mkYarnPackage, fetchFromGitHub, bundlerEnv
|
{ 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:
|
# Allow building a fork or custom version of Mastodon:
|
||||||
, pname ? "mastodon"
|
, pname ? "mastodon"
|
||||||
|
@ -96,10 +96,18 @@ stdenv.mkDerivation rec {
|
||||||
ln -s /var/log/mastodon log
|
ln -s /var/log/mastodon log
|
||||||
ln -s /tmp tmp
|
ln -s /tmp tmp
|
||||||
'';
|
'';
|
||||||
|
|
||||||
propagatedBuildInputs = [ imagemagick ffmpeg file mastodon-gems.wrappedRuby ];
|
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
|
mkdir -p $out
|
||||||
cp -r * $out/
|
cp -r * $out/
|
||||||
|
ln -s ${run-streaming} $out/run-streaming.sh
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
|
|
@ -17921,7 +17921,11 @@ in
|
||||||
|
|
||||||
mailman-web = with python3.pkgs; toPythonApplication mailman-web;
|
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 { };
|
mattermost = callPackage ../servers/mattermost { };
|
||||||
matterircd = callPackage ../servers/mattermost/matterircd.nix { };
|
matterircd = callPackage ../servers/mattermost/matterircd.nix { };
|
||||||
|
|
Loading…
Reference in a new issue