mastodon/default.nix

36 lines
970 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.lock";
sha256 = "05phsp5wj2p63vjd8hr9h39wxqwz3j8zqh4avj8mwrsh23ahkxgi";
};
});
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
'';
})