mastodon/default.nix

36 lines
970 B
Nix
Raw Permalink Normal View History

{ pkgs ? import <nixpkgs> { } }:
let
2021-09-03 11:32:57 +01:00
src = import ./source.nix;
2022-11-01 17:08:59 +00:00
phase1 = pkgs.mastodon.override {
pname = "mastodon-queer-af";
version = "main";
srcOverride = src;
dependenciesDir = src;
};
in
2022-11-01 17:37:02 +00:00
phase1.overrideAttrs (prev: rec {
mastodon-modules = prev.mastodon-modules.overrideAttrs (prev: {
pname = "${prev.pname}-mod";
2022-11-01 17:08:59 +00:00
yarnOfflineCache = pkgs.fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
sha256 = "05phsp5wj2p63vjd8hr9h39wxqwz3j8zqh4avj8mwrsh23ahkxgi";
2022-11-01 17:08:59 +00:00
};
});
2022-11-01 17:37:02 +00:00
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
'';
2022-11-01 17:08:59 +00:00
})