nixfiles/pkgs/akkoma-fe-domi/default.nix

43 lines
1.2 KiB
Nix
Raw Normal View History

2024-10-31 19:44:04 +01:00
{
akkoma-frontends,
fetchFromGitea,
fetchYarnDeps
}:
akkoma-frontends.akkoma-fe.overrideAttrs (let
src = fetchFromGitea {
domain = "git.sakamoto.pl";
owner = "domi";
repo = "akkoma-fe";
rev = "5f0339ce005ccb12365128089edb5fd77f60841b";
hash = "sha256-AHmJyOFmQZXmNMMsp8ONm9Itns1H/idEKl8+sxn2RSA=";
};
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-7WB6nmxNckMdftKds2OgD2kClvCCT/I5vmthV0jrkSs=";
};
in {
version = "unstable-2024-07-20";
pname = "akkoma-fe-domi";
inherit src offlineCache;
postPatch = ''
# Build scripts assume to be used within a Git repository checkout
2024-11-01 15:11:59 +01:00
substituteInPlace src/modules/instance.js \
--replace-fail "widenTimeline: true" 'widenTimeline: "50%"'
2024-10-31 19:44:04 +01:00
sed -E -i '/^let commitHash =/,/;$/clet commitHash = "${builtins.substring 0 7 src.rev}";' \
build/webpack.prod.conf.js
'';
configurePhase = ''
runHook preConfigure
export HOME="$(mktemp -d)"
yarn config --offline set yarn-offline-mirror ${offlineCache}
fixup-yarn-lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
runHook postConfigure
'';
})