nixpkgs/pkgs/by-name/wo/workout-tracker/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.3 KiB
Nix
Raw Normal View History

2024-03-16 08:01:28 +00:00
{
lib,
buildGoModule,
buildNpmPackage,
2024-03-16 08:01:28 +00:00
fetchFromGitHub,
nix-update-script,
nixosTests,
2024-03-16 08:01:28 +00:00
...
}:
let
2024-03-16 08:01:28 +00:00
pname = "workout-tracker";
2024-08-06 05:31:42 +00:00
version = "1.18.1";
2024-03-16 08:01:28 +00:00
src = fetchFromGitHub {
owner = "jovandeginste";
repo = "workout-tracker";
rev = "refs/tags/v${version}";
2024-08-06 05:31:42 +00:00
hash = "sha256-Sn6SOHrsp1ZgsPntc2+cmlAEPVBUrYv1vKLKAQvT9m4=";
2024-03-16 08:01:28 +00:00
};
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;
2024-03-16 08:01:28 +00:00
vendorHash = null;
postPatch = ''
ln -s ${assets}/node_modules ./node_modules
make build-dist
'';
2024-03-16 08:01:28 +00:00
passthru.updateScript = nix-update-script { };
passthru.tests = {
inherit (nixosTests) workout-tracker;
};
2024-03-16 08:01:28 +00:00
meta = {
changelog = "https://github.com/jovandeginste/workout-tracker/releases/tag/v${version}";
description = "Workout tracking web application for personal use";
homepage = "https://github.com/jovandeginste/workout-tracker";
license = lib.licenses.mit;
mainProgram = "workout-tracker";
maintainers = with lib.maintainers; [ bhankas ];
};
}