{ lib, fetchFromGitHub, nixosTests, rustPlatform, fetchNextcloudApp, }: rustPlatform.buildRustPackage rec { pname = "notify_push"; # NOTE: make sure this is compatible with all Nextcloud versions # in nixpkgs! # For that, check the `` section of `appinfo/info.xml` # in the app (https://github.com/nextcloud/notify_push/blob/main/appinfo/info.xml) version = "1.3.0"; src = fetchFromGitHub { owner = "nextcloud"; repo = "notify_push"; tag = "v${version}"; hash = "sha256-RdrwHlp3VlQkhyYr9XDWzqhNnNmUnd8hVAei8IkkNR8="; }; cargoHash = "sha256-+z9XaAzToLZg6/PoRigkvPVpZ/bX/t0VBR5bg3dCUVw="; passthru = rec { app = fetchNextcloudApp { appName = "notify_push"; appVersion = version; hash = "sha256-Z9vTAln//DYsx5VLWeJP1KBRF0to79F9aBLnpp+PdwA="; license = "agpl3Plus"; homepage = "https://github.com/nextcloud/notify_push"; url = "https://github.com/nextcloud-releases/notify_push/releases/download/v${version}/notify_push-v${version}.tar.gz"; description = "Push update support for desktop app"; }; test_client = rustPlatform.buildRustPackage { pname = "${pname}-test_client"; inherit src version; buildAndTestSubdir = "test_client"; cargoHash = "sha256-+z9XaAzToLZg6/PoRigkvPVpZ/bX/t0VBR5bg3dCUVw="; meta = meta // { mainProgram = "test_client"; }; }; tests = lib.filterAttrs ( key: lib.const (lib.hasPrefix "with-postgresql-and-redis" key) ) nixosTests.nextcloud // { inherit test_client; }; }; meta = { changelog = "https://github.com/nextcloud/notify_push/releases/tag/v${version}"; description = "Update notifications for nextcloud clients"; mainProgram = "notify_push"; homepage = "https://github.com/nextcloud/notify_push"; license = lib.licenses.agpl3Plus; platforms = lib.platforms.linux; maintainers = with lib.maintainers; [ das_j helsinki-Jo ]; }; }