From 47082f6caae6176d8b486fcb30c7a0adc6f91e90 Mon Sep 17 00:00:00 2001 From: liberodark Date: Tue, 28 Jan 2025 21:49:47 +0100 Subject: [PATCH 1/4] qownnotes: 25.1.5 -> 25.1.6 --- pkgs/by-name/qo/qownnotes/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/qo/qownnotes/package.nix b/pkgs/by-name/qo/qownnotes/package.nix index 08e95d1f341f5..d1fb38f3037de 100644 --- a/pkgs/by-name/qo/qownnotes/package.nix +++ b/pkgs/by-name/qo/qownnotes/package.nix @@ -15,14 +15,14 @@ let pname = "qownnotes"; appname = "QOwnNotes"; - version = "25.1.5"; + version = "25.1.6"; in stdenv.mkDerivation { inherit pname version; src = fetchurl { url = "https://github.com/pbek/QOwnNotes/releases/download/v${version}/qownnotes-${version}.tar.xz"; - hash = "sha256-Qr5pkKznosUGO7HvUkZhemWwtKpyYA79Vz1jU6YhODE="; + hash = "sha256-EmkOuxXH7XSpWrw3rtLPQ4XCX93RDbhnUR1edsNVJLk="; }; nativeBuildInputs = From 2db0ef3a8da472a69341aecc7a2daf241b4c414b Mon Sep 17 00:00:00 2001 From: liberodark Date: Wed, 29 Jan 2025 08:48:37 +0100 Subject: [PATCH 2/4] qownnotes: improve meta --- pkgs/by-name/qo/qownnotes/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/qo/qownnotes/package.nix b/pkgs/by-name/qo/qownnotes/package.nix index d1fb38f3037de..668e16a0139f4 100644 --- a/pkgs/by-name/qo/qownnotes/package.nix +++ b/pkgs/by-name/qo/qownnotes/package.nix @@ -79,17 +79,17 @@ stdenv.mkDerivation { # Tests QOwnNotes using the NixOS module by launching xterm: passthru.tests.basic-nixos-module-functionality = nixosTests.qownnotes; - meta = with lib; { + meta = { description = "Plain-text file notepad and todo-list manager with markdown support and Nextcloud/ownCloud integration"; homepage = "https://www.qownnotes.org/"; changelog = "https://www.qownnotes.org/changelog.html"; downloadPage = "https://github.com/pbek/QOwnNotes/releases/tag/v${version}"; - license = licenses.gpl2Only; - maintainers = with maintainers; [ + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ pbek totoroot matthiasbeyer ]; - platforms = platforms.unix; + platforms = lib.platforms.unix; }; } From 54ddab9dff910352aee24d2116279169aa48de43 Mon Sep 17 00:00:00 2001 From: liberodark Date: Wed, 29 Jan 2025 08:50:29 +0100 Subject: [PATCH 3/4] qownnotes: add update script --- pkgs/by-name/qo/qownnotes/package.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/by-name/qo/qownnotes/package.nix b/pkgs/by-name/qo/qownnotes/package.nix index 668e16a0139f4..eedc69cf24538 100644 --- a/pkgs/by-name/qo/qownnotes/package.nix +++ b/pkgs/by-name/qo/qownnotes/package.nix @@ -10,6 +10,8 @@ nixosTests, installShellFiles, xvfb-run, + versionCheckHook, + nix-update-script, }: let @@ -79,6 +81,16 @@ stdenv.mkDerivation { # Tests QOwnNotes using the NixOS module by launching xterm: passthru.tests.basic-nixos-module-functionality = nixosTests.qownnotes; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = [ "--version" ]; + doInstallCheck = true; + + passthru = { + updateScript = nix-update-script { }; + }; + meta = { description = "Plain-text file notepad and todo-list manager with markdown support and Nextcloud/ownCloud integration"; homepage = "https://www.qownnotes.org/"; From 3b92f76bc53659705dcd2e94f009a696713d5011 Mon Sep 17 00:00:00 2001 From: liberodark Date: Wed, 29 Jan 2025 08:51:25 +0100 Subject: [PATCH 4/4] qownnotes: switch to finalAttrs --- pkgs/by-name/qo/qownnotes/package.nix | 35 ++++++++++++--------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/pkgs/by-name/qo/qownnotes/package.nix b/pkgs/by-name/qo/qownnotes/package.nix index eedc69cf24538..d738a084f31d7 100644 --- a/pkgs/by-name/qo/qownnotes/package.nix +++ b/pkgs/by-name/qo/qownnotes/package.nix @@ -14,16 +14,13 @@ nix-update-script, }: -let +stdenv.mkDerivation (finalAttrs: { pname = "qownnotes"; appname = "QOwnNotes"; version = "25.1.6"; -in -stdenv.mkDerivation { - inherit pname version; src = fetchurl { - url = "https://github.com/pbek/QOwnNotes/releases/download/v${version}/qownnotes-${version}.tar.xz"; + url = "https://github.com/pbek/QOwnNotes/releases/download/v${finalAttrs.version}/qownnotes-${finalAttrs.version}.tar.xz"; hash = "sha256-EmkOuxXH7XSpWrw3rtLPQ4XCX93RDbhnUR1edsNVJLk="; }; @@ -54,28 +51,28 @@ stdenv.mkDerivation { # Install shell completion on Linux (with xvfb-run) postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' - installShellCompletion --cmd ${appname} \ - --bash <(xvfb-run $out/bin/${appname} --completion bash) \ - --fish <(xvfb-run $out/bin/${appname} --completion fish) - installShellCompletion --cmd ${pname} \ - --bash <(xvfb-run $out/bin/${appname} --completion bash) \ - --fish <(xvfb-run $out/bin/${appname} --completion fish) + installShellCompletion --cmd ${finalAttrs.appname} \ + --bash <(xvfb-run $out/bin/${finalAttrs.appname} --completion bash) \ + --fish <(xvfb-run $out/bin/${finalAttrs.appname} --completion fish) + installShellCompletion --cmd ${finalAttrs.pname} \ + --bash <(xvfb-run $out/bin/${finalAttrs.appname} --completion bash) \ + --fish <(xvfb-run $out/bin/${finalAttrs.appname} --completion fish) '' # Install shell completion on macOS + lib.optionalString stdenv.isDarwin '' - installShellCompletion --cmd ${pname} \ - --bash <($out/bin/${appname} --completion bash) \ - --fish <($out/bin/${appname} --completion fish) + installShellCompletion --cmd ${finalAttrs.pname} \ + --bash <($out/bin/${finalAttrs.appname} --completion bash) \ + --fish <($out/bin/${finalAttrs.appname} --completion fish) '' # Create a lowercase symlink for Linux + lib.optionalString stdenv.hostPlatform.isLinux '' - ln -s $out/bin/${appname} $out/bin/${pname} + ln -s $out/bin/${finalAttrs.appname} $out/bin/${finalAttrs.pname} '' # Rename application for macOS as lowercase binary + lib.optionalString stdenv.hostPlatform.isDarwin '' # Prevent "same file" error - mv $out/bin/${appname} $out/bin/${pname}.bin - mv $out/bin/${pname}.bin $out/bin/${pname} + mv $out/bin/${finalAttrs.appname} $out/bin/${finalAttrs.pname}.bin + mv $out/bin/${finalAttrs.pname}.bin $out/bin/${finalAttrs.pname} ''; # Tests QOwnNotes using the NixOS module by launching xterm: @@ -95,7 +92,7 @@ stdenv.mkDerivation { description = "Plain-text file notepad and todo-list manager with markdown support and Nextcloud/ownCloud integration"; homepage = "https://www.qownnotes.org/"; changelog = "https://www.qownnotes.org/changelog.html"; - downloadPage = "https://github.com/pbek/QOwnNotes/releases/tag/v${version}"; + downloadPage = "https://github.com/pbek/QOwnNotes/releases/tag/v${finalAttrs.version}"; license = lib.licenses.gpl2Only; maintainers = with lib.maintainers; [ pbek @@ -104,4 +101,4 @@ stdenv.mkDerivation { ]; platforms = lib.platforms.unix; }; -} +})