diff options
Diffstat (limited to 'pkgs/by-name/vi')
-rw-r--r-- | pkgs/by-name/vi/vikunja/package.nix | 70 |
1 files changed, 10 insertions, 60 deletions
diff --git a/pkgs/by-name/vi/vikunja/package.nix b/pkgs/by-name/vi/vikunja/package.nix index cc9891f3ccd15..26640e2ed09d8 100644 --- a/pkgs/by-name/vi/vikunja/package.nix +++ b/pkgs/by-name/vi/vikunja/package.nix @@ -1,4 +1,4 @@ -{ lib, fetchFromGitHub, stdenv, stdenvNoCC, nodePackages, buildGoModule, jq, mage, writeShellScriptBin, nixosTests, buildNpmPackage, moreutils, cacert }: +{ lib, fetchFromGitHub, stdenv, nodejs, pnpm, buildGoModule, mage, writeShellScriptBin, nixosTests }: let version = "0.23.0"; @@ -13,72 +13,20 @@ let pname = "vikunja-frontend"; inherit version src; - postPatch = '' - cd frontend - ''; - - pnpmDeps = stdenvNoCC.mkDerivation { - pname = "${finalAttrs.pname}-pnpm-deps"; - inherit (finalAttrs) src version; - - nativeBuildInputs = [ - jq - nodePackages.pnpm - moreutils - cacert - ]; - - pnpmPatch = builtins.toJSON { - pnpm.supportedArchitectures = { - os = [ "linux" ]; - cpu = [ "x64" "arm64" ]; - }; - }; - - postPatch = '' - cd frontend - mv package.json package.json.orig - jq --raw-output ". * $pnpmPatch" package.json.orig > package.json - ''; + sourceRoot = "${finalAttrs.src.name}/frontend"; - # https://github.com/NixOS/nixpkgs/blob/763e59ffedb5c25774387bf99bc725df5df82d10/pkgs/applications/misc/pot/default.nix#L56 - installPhase = '' - export HOME=$(mktemp -d) - - pnpm config set store-dir $out - pnpm install --frozen-lockfile --ignore-script - - rm -rf $out/v3/tmp - for f in $(find $out -name "*.json"); do - sed -i -E -e 's/"checkedAt":[0-9]+,//g' $f - jq --sort-keys . $f | sponge $f - done - ''; - - dontBuild = true; - dontFixup = true; - outputHashMode = "recursive"; - outputHash = { - x86_64-linux = "sha256-ybAkXe2/VhGZhr59ZQOcQ+SI2a204e8uPjyE40xUVwU="; - aarch64-linux = "sha256-2iURs6JtI/b2+CnLwhog1X5hSFFO6OmmgFRuTbMjH+k="; - }.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}"); + pnpmDeps = pnpm.fetchDeps { + inherit (finalAttrs) pname version src sourceRoot; + hash = "sha256-awQgOLkb46v2aWfw6yv+zGPoOnczalkzg02tBgMTyMY="; }; nativeBuildInputs = [ - nodePackages.pnpm - nodePackages.nodejs + nodejs + pnpm.configHook ]; doCheck = true; - preBuild = '' - export HOME=$(mktemp -d) - - pnpm config set store-dir ${finalAttrs.pnpmDeps} - pnpm install --offline --frozen-lockfile --ignore-script - patchShebangs node_modules/{*,.*} - ''; - postBuild = '' pnpm run build ''; @@ -121,8 +69,10 @@ buildGoModule { vendorHash = "sha256-d4AeQEAtPqMDe5a5aKhCe3i3pDXAMZJkJXxfcAFTx7A="; + inherit frontend; + prePatch = '' - cp -r ${frontend} frontend/dist + cp -r $frontend frontend/dist ''; postConfigure = '' |