Skip to content

Commit

Permalink
vikunja-desktop: init at 0.24.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kolaente committed Sep 28, 2024
1 parent c9e4eba commit a7cab86
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 1 deletion.
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@

- [ToDesk](https://www.todesk.com/linux.html), a remote desktop applicaton. Available as [services.todesk.enable](#opt-services.todesk.enable).

- The desktop application of [Vikunja](https://vikunja.io) is now available in nixpkgs.

- [Dependency Track](https://dependencytrack.org/), an intelligent Component Analysis platform that allows organizations to identify and reduce risk in the software supply chain. Available as [services.dependency-track](option.html#opt-services.dependency-track).

- [Immich](https://github.com/immich-app/immich), a self-hosted photo and video backup solution. Available as [services.immich](#opt-services.immich.enable).
Expand Down
119 changes: 119 additions & 0 deletions pkgs/by-name/vi/vikunja-desktop/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
lib,
stdenv,
makeWrapper,
makeDesktopItem,
callPackage,
pnpm,
nodejs,
electron,
unstableGitUpdater,
fetchFromGitHub,
fetchzip,
vikunja,
}:

let
executableName = "vikunja-desktop";
version = "0.24.3";
src = fetchFromGitHub {
owner = "go-vikunja";
repo = "vikunja";
rev = "v${version}";
hash = "sha256-UT2afhjEangilvflmxxahj7pEiJUWxqUL1Eni1JvuRI=";
};
in
stdenv.mkDerivation (finalAttrs: {
name = "vikunja-desktop-${version}";
pname = finalAttrs.name;
inherit version src;

sourceRoot = "${finalAttrs.src.name}/desktop";

pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs)
pname
version
src
sourceRoot
;
hash = "sha256-5kBQS2nW9VqbWB+Kqe6+/gEPmB5Fj3n7zu2De4Q5GZ0=";
};

env = {
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
};

nativeBuildInputs = [
makeWrapper
nodejs
pnpm.configHook
vikunja.passthru.frontend
];

buildPhase = ''
runHook preBuild
sed -i "s/\$${version}/${version}/g" package.json
sed -i "s/\"version\": \".*\"/\"version\": \"${version}\"/" package.json
pnpm run pack -c.electronDist="${electron.dist}" -c.electronVersion="${electron.version}"
runHook postBuild
'';

doCheck = false;

installPhase = ''
runHook preInstall
mkdir -p "$out/share/lib/vikunja-desktop"
cp -r ./dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/vikunja-desktop"
cp -r ./node_modules "$out/share/lib/vikunja-desktop/resources"
ln -s '${vikunja.passthru.frontend}' "$out/share/lib/vikunja-desktop/resources/frontend"
install -Dm644 "build/icon.png" "$out/share/icons/hicolor/256x256/apps/vikunja-desktop.png"
# use makeShellWrapper (instead of the makeBinaryWrapper provided by wrapGAppsHook3) for proper shell variable expansion
# see https://github.com/NixOS/nixpkgs/issues/172583
makeShellWrapper "${lib.getExe electron}" "$out/bin/vikunja-desktop" \
--add-flags "$out/share/lib/vikunja-desktop/resources/app.asar" \
"''${gappsWrapperArgs[@]}" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=UseOzonePlatform,WaylandWindowDecorations,WebRTCPipeWireCapturer}}" \
--set-default ELECTRON_IS_DEV 0 \
--inherit-argv0
runHook postInstall
'';

# Do not attempt generating a tarball for vikunja-frontend again.
distPhase = ''
true
'';

passthru.updateScript = unstableGitUpdater {
url = "${src.meta.homepage}.git";
};

# The desktop item properties should be kept in sync with data from upstream:
desktopItem = makeDesktopItem {
name = "vikunja-desktop";
exec = executableName;
icon = "vikunja";
desktopName = "Vikunja Desktop";
genericName = "To-Do list app";
comment = finalAttrs.meta.description;
categories = [
"ProjectManagement"
"Office"
];
};

meta = with lib; {
description = "Desktop App of the Vikunja to-do list app";
homepage = "https://vikunja.io/";
license = licenses.gpl3Plus;
maintainers = with lib.maintainers; [ kolaente ];
inherit (electron.meta) platforms;
};
})
5 changes: 4 additions & 1 deletion pkgs/by-name/vi/vikunja/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ buildGoModule {
runHook postInstall
'';

passthru.tests.vikunja = nixosTests.vikunja;
passthru = {
tests.vikunja = nixosTests.vikunja;
frontend = frontend;
};

meta = {
changelog = "https://kolaente.dev/vikunja/api/src/tag/v${version}/CHANGELOG.md";
Expand Down

0 comments on commit a7cab86

Please sign in to comment.