lemmy: fix ui commit_hash path

This commit is contained in:
happysalada
2023-08-27 20:44:10 +08:00
committed by Yt
parent c3ed95307e
commit 676fe5e01b
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ in
root * ${cfg.ui.package}/dist
file_server
}
handle_path /static/undefined/* {
handle_path /static/${cfg.ui.package.passthru.commit_sha}/* {
root * ${cfg.ui.package}/dist
file_server
}
+8
View File
@@ -55,6 +55,13 @@ mkYarnPackage {
hash = pinData.uiYarnDepsHash;
};
patchPhase = ''
substituteInPlace ./package.json \
--replace '$(git rev-parse --short HEAD)' "${src.rev}" \
--replace 'yarn clean' 'yarn --offline clean' \
--replace 'yarn run rimraf dist' 'yarn --offline run rimraf dist'
'';
yarnPreBuild = ''
export npm_config_nodedir=${nodejs}
'';
@@ -79,6 +86,7 @@ mkYarnPackage {
passthru.updateScript = ./update.py;
passthru.tests.lemmy-ui = nixosTests.lemmy;
passthru.commit_sha = src.rev;
meta = with lib; {
description = "Building a federated alternative to reddit in rust";