mastodon/default.nix

36 lines
971 B
Nix

{ pkgs ? import <nixpkgs> { } }:
let
src = import ./source.nix;
phase1 = pkgs.mastodon.override {
pname = "mastodon-queer-af";
version = "main";
srcOverride = src;
dependenciesDir = src;
};
in
phase1.overrideAttrs (prev: rec {
mastodon-modules = prev.mastodon-modules.overrideAttrs (prev: {
pname = "${prev.pname}-mod";
yarnOfflineCache = pkgs.fetchYarnDeps {
yarnLock = "${src}/yarn.lockd";
sha256 = "0v47h3a0cw5fhffp0bajazd3731zkzqvn0vh4klpd4a29mf26y6n";
};
});
buildPhase = ''
ln -s ${mastodon-modules}/node_modules node_modules
ln -s ${mastodon-modules}/public/assets public/assets
ln -s ${mastodon-modules}/public/packs public/packs
patchShebangs bin/
for b in $(ls ${prev.mastodon-gems}/bin/)
do
if [ ! -f bin/$b ]; then
ln -s ${prev.mastodon-gems}/bin/$b bin/$b
fi
done
rm -rf log
ln -s /var/log/mastodon log
ln -s /tmp tmp
'';
})