22 appname = "QOwnNotes";
26 inherit pname version;
29 url = "https://github.com/pbek/QOwnNotes/releases/download/v${version}/qownnotes-${version}.tar.xz";
30 hash = "sha256-OiaZmd50kOTJSJesBYFdjjKzNUc/m7XrU5S27z0mtAI=";
39 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ xvfb-run ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeWrapper ];
47 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ];
51 "-DBUILD_WITH_SYSTEM_BOTAN=ON"
54 # Install shell completion on Linux (with xvfb-run)
55 postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
56 installShellCompletion --cmd ${appname} \
57 --bash <(xvfb-run $out/bin/${appname} --completion bash) \
58 --fish <(xvfb-run $out/bin/${appname} --completion fish)
59 installShellCompletion --cmd ${pname} \
60 --bash <(xvfb-run $out/bin/${appname} --completion bash) \
61 --fish <(xvfb-run $out/bin/${appname} --completion fish)
63 # Install shell completion on macOS
64 + lib.optionalString stdenv.isDarwin ''
65 installShellCompletion --cmd ${pname} \
66 --bash <($out/bin/${appname} --completion bash) \
67 --fish <($out/bin/${appname} --completion fish)
69 # Create a lowercase symlink for Linux
70 + lib.optionalString stdenv.hostPlatform.isLinux ''
71 ln -s $out/bin/${appname} $out/bin/${pname}
73 # Rename application for macOS as lowercase binary
74 + lib.optionalString stdenv.hostPlatform.isDarwin ''
75 # Prevent "same file" error
76 mv $out/bin/${appname} $out/bin/${pname}.bin
77 mv $out/bin/${pname}.bin $out/bin/${pname}
80 # Tests QOwnNotes using the NixOS module by launching xterm:
81 passthru.tests.basic-nixos-module-functionality = nixosTests.qownnotes;
84 description = "Plain-text file notepad and todo-list manager with markdown support and Nextcloud/ownCloud integration";
85 homepage = "https://www.qownnotes.org/";
86 changelog = "https://www.qownnotes.org/changelog.html";
87 downloadPage = "https://github.com/pbek/QOwnNotes/releases/tag/v${version}";
88 license = licenses.gpl2Only;
89 maintainers = with maintainers; [ pbek totoroot ];
90 platforms = platforms.unix;