Skip to content

Commit

Permalink
lemmy: fix ui commit_hash path
Browse files Browse the repository at this point in the history
  • Loading branch information
happysalada authored and Yt committed Aug 27, 2023
1 parent c3ed953 commit 676fe5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nixos/modules/services/web-apps/lemmy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 8 additions & 0 deletions pkgs/servers/web-apps/lemmy/ui.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}
'';
Expand All @@ -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";
Expand Down

0 comments on commit 676fe5e

Please sign in to comment.