From c1cbe0cb6b78a6b3a11805f600b9b3d16c2f0f0b Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Mon, 10 Aug 2026 20:16:56 -0400 Subject: [PATCH 1/2] vikunja: build veans package (cherry picked from commit 2280f2bb2a14b3b6448f7df9ad66f3e06d1ab22b) --- pkgs/by-name/vi/vikunja/package.nix | 16 +++++++-- pkgs/by-name/vi/vikunja/update.sh | 53 ----------------------------- pkgs/by-name/vi/vikunja/veans.nix | 34 ++++++++++++++++++ 3 files changed, 47 insertions(+), 56 deletions(-) delete mode 100755 pkgs/by-name/vi/vikunja/update.sh create mode 100644 pkgs/by-name/vi/vikunja/veans.nix diff --git a/pkgs/by-name/vi/vikunja/package.nix b/pkgs/by-name/vi/vikunja/package.nix index 684b72a32d15..676747e6b222 100644 --- a/pkgs/by-name/vi/vikunja/package.nix +++ b/pkgs/by-name/vi/vikunja/package.nix @@ -1,5 +1,6 @@ { lib, + callPackage, fetchFromGitHub, stdenv, nodejs_24, @@ -11,6 +12,7 @@ dart-sass, writeShellScriptBin, nixosTests, + nix-update-script, }: let @@ -82,7 +84,7 @@ let }' ${file} ''; in -buildGoModule { +buildGoModule (finalAttrs: { inherit src version; pname = "vikunja"; @@ -105,6 +107,7 @@ buildGoModule { vendorHash = "sha256-bn+bcGzeB0/KkhPNkbjK/EgKQG3iqVlJxtt6betGUNE="; inherit frontend; + veans = callPackage ./veans.nix { inherit (finalAttrs) src version meta; }; prePatch = '' cp -r ${frontend} frontend/dist @@ -143,7 +146,14 @@ buildGoModule { passthru = { tests.vikunja = nixosTests.vikunja; frontend = frontend; - updateScript = ./update.sh; + updateScript = nix-update-script { + extraArgs = [ + "--subpackage" + "frontend" + "--subpackage" + "veans" + ]; + }; }; meta = { @@ -158,4 +168,4 @@ buildGoModule { mainProgram = "vikunja"; platforms = lib.platforms.linux; }; -} +}) diff --git a/pkgs/by-name/vi/vikunja/update.sh b/pkgs/by-name/vi/vikunja/update.sh deleted file mode 100755 index 1c09f61cb0f6..000000000000 --- a/pkgs/by-name/vi/vikunja/update.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p nix wget jq nurl - -# shellcheck shell=bash - -set -euo pipefail - -if [[ $# -gt 1 || "${1:-}" == -* ]]; then - echo "Regenerates packaging data for the vikunja package." - echo "Usage: $0 [version]" - exit 1 -fi - -version="${1:-}" - -NIXPKGS_ROOT="$(git rev-parse --show-toplevel)" - -if [ -z "$version" ]; then - TOKEN_ARGS=() - if [ -n "${GITHUB_TOKEN:-}" ]; then - TOKEN_ARGS=(--header "Authorization: token $GITHUB_TOKEN") - fi - version="$(wget -q -O- ${TOKEN_ARGS[@]+"${TOKEN_ARGS[@]}"} "https://api.github.com/repos/go-vikunja/vikunja/releases?per_page=10" | jq -r '[.[] | select(.prerelease == false)][0].tag_name')" -fi - -# strip leading "v" -version="${version#v}" - -cd "$(dirname "$0")" - -# Update version, blank out all hashes so nurl can recompute them -sed -i -E 's#version = ".*"#version = "'"$version"'"#' package.nix -sed -i -E '/fetchFromGitHub \{/,/\};/ s#hash = ".*"#hash = ""#' package.nix -sed -i -E '/fetchPnpmDeps \{/,/\};/ s#hash = ".*"#hash = ""#' package.nix -sed -i -E 's#vendorHash = ".*"#vendorHash = ""#' package.nix - -# Source hash (must be computed first, pnpm and vendor depend on it) -src_hash=$(nurl -e "(import $NIXPKGS_ROOT/. { }).vikunja.src") -sed -i -E '/fetchFromGitHub \{/,/\};/ s#hash = ".*"#hash = "'"$src_hash"'"#' package.nix - -# pnpm dependencies hash for frontend -pnpm_hash=$(nurl -e "(import $NIXPKGS_ROOT/. { }).vikunja.frontend.pnpmDeps") -sed -i -E '/fetchPnpmDeps \{/,/\};/ s#hash = ".*"#hash = "'"$pnpm_hash"'"#' package.nix - -# Go modules vendor hash -vendor_hash=$(nurl -e "(import $NIXPKGS_ROOT/. { }).vikunja.goModules") -sed -i -E 's#vendorHash = ".*"#vendorHash = "'"$vendor_hash"'"#' package.nix - -echo "Update complete!" -echo "Version: $version" -echo "Source hash: $src_hash" -echo "Frontend pnpm hash: $pnpm_hash" -echo "Go vendor hash: $vendor_hash" diff --git a/pkgs/by-name/vi/vikunja/veans.nix b/pkgs/by-name/vi/vikunja/veans.nix new file mode 100644 index 000000000000..a5092462871c --- /dev/null +++ b/pkgs/by-name/vi/vikunja/veans.nix @@ -0,0 +1,34 @@ +{ + meta, + src, + version, + + buildGoModule, +}: + +buildGoModule (finalAttrs: { + pname = "veans"; + inherit src version; + + __structuredAttrs = true; + + modRoot = "veans"; + + vendorHash = "sha256-4Ayug+r7sWL/JZI8fGCyDZ1SaTwCvSWrQpqv7uYCHhc="; + + env.CGO_ENABLED = 0; + + ldflags = [ + "-s" + "-X main.version=v${finalAttrs.version}" + ]; + + # needs a running vikunja instance + doCheck = false; + + meta = meta // { + description = "A beans-shaped CLI for Vikunja"; + homepage = "https://vikunja.io/docs/veans/"; + mainProgram = "veans"; + }; +}) From 9823eb6af07dfe4cb8b837e238fda469396d89bf Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Mon, 31 Aug 2026 22:27:43 -0400 Subject: [PATCH 2/2] vikunja: 2.5.0 -> 2.6.0 Changelog: https://github.com/go-vikunja/vikunja/blob/v2.6.0/CHANGELOG.md (cherry picked from commit af7a99386b78c55d803e285bef8cd357cb6bd3da) --- pkgs/by-name/vi/vikunja/frontend.nix | 68 +++++++++++++++++ pkgs/by-name/vi/vikunja/package.nix | 107 +++++++++------------------ pkgs/by-name/vi/vikunja/veans.nix | 2 +- 3 files changed, 104 insertions(+), 73 deletions(-) create mode 100644 pkgs/by-name/vi/vikunja/frontend.nix diff --git a/pkgs/by-name/vi/vikunja/frontend.nix b/pkgs/by-name/vi/vikunja/frontend.nix new file mode 100644 index 000000000000..96ee618d35ed --- /dev/null +++ b/pkgs/by-name/vi/vikunja/frontend.nix @@ -0,0 +1,68 @@ +{ + src, + version, + + lib, + stdenv, + nodejs_24, + pnpm_10, + fetchPnpmDeps, + pnpmConfigHook, + dart-sass, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "vikunja-frontend"; + inherit version src; + + sourceRoot = "${finalAttrs.src.name}/frontend"; + + pnpmDeps = fetchPnpmDeps { + inherit (finalAttrs) + pname + version + src + sourceRoot + ; + pnpm = pnpm_10; + fetcherVersion = 3; + hash = "sha256-aQWTzJZU6NJrZxuoCeQDJjujPq+niixmFvqtPdWS4wk="; + }; + + nativeBuildInputs = [ + nodejs_24 + dart-sass + pnpmConfigHook + pnpm_10 + ]; + + postPatch = '' + substituteInPlace src/version.json \ + --replace-fail '"dev"' '"${finalAttrs.version}"' + ''; + + postBuild = '' + # Force sass-embedded to use our dart-sass instead of bundled binaries. + substituteInPlace node_modules/sass-embedded/dist/lib/src/compiler-path.js \ + --replace-fail 'compilerCommand = (() => {' 'compilerCommand = (() => { return ["${lib.getExe dart-sass}"];' + pnpm run build + ''; + + doCheck = true; + + checkPhase = '' + runHook preCheck + + pnpm run test:unit --run + + runHook postCheck + ''; + + installPhase = '' + runHook preInstall + + cp -r dist/ $out + + runHook postInstall + ''; +}) diff --git a/pkgs/by-name/vi/vikunja/package.nix b/pkgs/by-name/vi/vikunja/package.nix index 676747e6b222..2d838dd52a0a 100644 --- a/pkgs/by-name/vi/vikunja/package.nix +++ b/pkgs/by-name/vi/vikunja/package.nix @@ -2,75 +2,16 @@ lib, callPackage, fetchFromGitHub, - stdenv, - nodejs_24, - pnpm_10, - fetchPnpmDeps, - pnpmConfigHook, - buildGoModule, + buildGo127Module, mage, - dart-sass, + writableTmpDirAsHomeHook, writeShellScriptBin, nixosTests, nix-update-script, }: let - version = "2.5.0"; - src = fetchFromGitHub { - owner = "go-vikunja"; - repo = "vikunja"; - rev = "v${version}"; - hash = "sha256-qI4mkgcN9yYRmh5V+KzIHupX7uWsszV4Xb31OYvukxQ="; - }; - - frontend = stdenv.mkDerivation (finalAttrs: { - pname = "vikunja-frontend"; - inherit version src; - - sourceRoot = "${finalAttrs.src.name}/frontend"; - - pnpmDeps = fetchPnpmDeps { - inherit (finalAttrs) - pname - version - src - sourceRoot - ; - pnpm = pnpm_10; - fetcherVersion = 3; - hash = "sha256-xZBgE4GM59Ihl5a3qgcmkjR4Q3wYlcsiDapiNEzBQOg="; - }; - - nativeBuildInputs = [ - nodejs_24 - dart-sass - pnpmConfigHook - pnpm_10 - ]; - - postPatch = '' - substituteInPlace src/version.json \ - --replace-fail '"dev"' '"${finalAttrs.version}"' - ''; - - doCheck = true; - - postBuild = '' - # Force sass-embedded to use our dart-sass instead of bundled binaries. - substituteInPlace node_modules/sass-embedded/dist/lib/src/compiler-path.js \ - --replace-fail 'compilerCommand = (() => {' 'compilerCommand = (() => { return ["${lib.getExe dart-sass}"];' - pnpm run build - ''; - - checkPhase = '' - pnpm run test:unit --run - ''; - - installPhase = '' - cp -r dist/ $out - ''; - }); + buildGoModule = buildGo127Module; # Injects a `t.Skip()` into a given test since there's apparently no other way to skip tests here. skipTest = @@ -85,14 +26,21 @@ let ''; in buildGoModule (finalAttrs: { - inherit src version; pname = "vikunja"; + version = "2.6.0"; + + src = fetchFromGitHub { + owner = "go-vikunja"; + repo = "vikunja"; + rev = "v${finalAttrs.version}"; + hash = "sha256-Xh1ozUTOVqywk0i8xQWkG/bPRgPH9EABjRW8p4do1mE="; + }; nativeBuildInputs = let fakeGit = writeShellScriptBin "git" '' if [[ $@ = "describe --tags --always --abbrev=10" ]]; then - echo "${version}" + echo "${finalAttrs.version}" else >&2 echo "Unknown command: $@" exit 1 @@ -102,15 +50,23 @@ buildGoModule (finalAttrs: { [ fakeGit mage + # mage wants to write some files to HOME + writableTmpDirAsHomeHook ]; - vendorHash = "sha256-bn+bcGzeB0/KkhPNkbjK/EgKQG3iqVlJxtt6betGUNE="; + vendorHash = "sha256-R6M5UyF10pIdoAvjWnS6Dqe/U6LTxmS6OwRTgmxfU4g="; - inherit frontend; - veans = callPackage ./veans.nix { inherit (finalAttrs) src version meta; }; + frontend = callPackage ./frontend.nix { + inherit (finalAttrs) src version; + }; + + veans = callPackage ./veans.nix { + inherit (finalAttrs) src version meta; + inherit buildGoModule; + }; prePatch = '' - cp -r ${frontend} frontend/dist + cp -r ${finalAttrs.frontend} frontend/dist ''; postConfigure = '' @@ -125,27 +81,34 @@ buildGoModule (finalAttrs: { buildPhase = '' runHook preBuild - # Fixes "mkdir /homeless-shelter: permission denied" - "Error: error compiling magefiles" during build - export HOME=$(mktemp -d) mage build:build runHook postBuild ''; checkPhase = '' + runHook preCheck + mage test:feature mage test:web + + runHook postCheck ''; installPhase = '' runHook preInstall + install -Dt $out/bin vikunja + runHook postInstall ''; passthru = { + # used by vikunja-desktop + inherit (finalAttrs) frontend; + tests.vikunja = nixosTests.vikunja; - frontend = frontend; + updateScript = nix-update-script { extraArgs = [ "--subpackage" @@ -157,7 +120,7 @@ buildGoModule (finalAttrs: { }; meta = { - changelog = "https://github.com/go-vikunja/vikunja/blob/v${version}/CHANGELOG.md"; + changelog = "https://github.com/go-vikunja/vikunja/blob/v${finalAttrs.version}/CHANGELOG.md"; description = "Todo-app to organize your life"; homepage = "https://vikunja.io/"; license = lib.licenses.agpl3Plus; diff --git a/pkgs/by-name/vi/vikunja/veans.nix b/pkgs/by-name/vi/vikunja/veans.nix index a5092462871c..d5917a71d603 100644 --- a/pkgs/by-name/vi/vikunja/veans.nix +++ b/pkgs/by-name/vi/vikunja/veans.nix @@ -14,7 +14,7 @@ buildGoModule (finalAttrs: { modRoot = "veans"; - vendorHash = "sha256-4Ayug+r7sWL/JZI8fGCyDZ1SaTwCvSWrQpqv7uYCHhc="; + vendorHash = "sha256-ac2M7wNlOn6ku8sn/rZmPCSGPodw88ufR8tr1lh54II="; env.CGO_ENABLED = 0;