Skip to content

Commit

Permalink
workout-tracker: add assets
Browse files Browse the repository at this point in the history
From server log:
```sh
12:58PM WRN Not Found app=workout-tracker version=local sha=local module=webserver request.time="2024-09-15 12:58:39.875195 +0400 +04" request.method=GET request.host=localhost:8080 request.path=/assets/dist/htmx.min.js request.query="" request.params=map[*:/dist/htmx.min.js] request.route=/assets* request.ip=127.0.0.1 request.referer=http://localhost:8080/user/signin request.length=0 response.time="2024-09-15 12:58:39.875636 +0400 +04" response.latency=441.574µs response.status=404 response.length=0 error="map[code:404 internal:<nil> message:Not Found]"
```

(cherry picked from commit 47d2cf0)
  • Loading branch information
sikmir authored and github-actions[bot] committed Sep 17, 2024
1 parent 48cf717 commit a105242
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions pkgs/by-name/wo/workout-tracker/package.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
lib,
buildGoModule,
buildNpmPackage,
fetchFromGitHub,
nix-update-script,
...
}:

buildGoModule rec {
let
pname = "workout-tracker";
version = "0.14.3";

Expand All @@ -17,8 +17,31 @@ buildGoModule rec {
hash = "sha256-NGj3W6SYZauaAhMinPzsSXM8Dqy+B+am985JJjh6xTs=";
};

assets = buildNpmPackage {
pname = "${pname}-assets";
inherit version src;
npmDepsHash = "sha256-jHpvCMgjGvaAOfbslaIKfIRiPafScpn3WLnYamm+lbs=";
dontNpmBuild = true;
postPatch = ''
rm Makefile
'';
installPhase = ''
runHook preInstall
cp -r . "$out"
runHook postInstall
'';
};
in
buildGoModule rec {
inherit pname version src;

vendorHash = null;

postPatch = ''
ln -s ${assets}/node_modules ./node_modules
make build-dist
'';

passthru.updateScript = nix-update-script { };

meta = {
Expand Down

0 comments on commit a105242

Please sign in to comment.