diff --git a/pkgs/shells/nushell/plugins/default.nix b/pkgs/shells/nushell/plugins/default.nix index d689e49b43e12..a437236e061ac 100644 --- a/pkgs/shells/nushell/plugins/default.nix +++ b/pkgs/shells/nushell/plugins/default.nix @@ -23,6 +23,7 @@ lib.makeScope newScope ( skim = callPackage ./skim.nix { }; semver = callPackage ./semver.nix { }; hcl = callPackage ./hcl.nix { }; + desktop-notifications = callPackage ./desktop-notifications.nix { }; } // lib.optionalAttrs config.allowAliases { regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release."; diff --git a/pkgs/shells/nushell/plugins/desktop-notifications.nix b/pkgs/shells/nushell/plugins/desktop-notifications.nix new file mode 100644 index 0000000000000..e5fe8177ae9b6 --- /dev/null +++ b/pkgs/shells/nushell/plugins/desktop-notifications.nix @@ -0,0 +1,40 @@ +{ + stdenv, + lib, + rustPlatform, + pkg-config, + nix-update-script, + fetchFromGitHub, + writableTmpDirAsHomeHook, +}: + +rustPlatform.buildRustPackage { + pname = "nu_plugin_desktop_notifications"; + version = "1.2.11-unstable-2025-05-05"; + + src = fetchFromGitHub { + repo = "nu_plugin_desktop_notifications"; + owner = "FMotalleb"; + rev = "de4464bf6ce6503977ee2bd41f11aeabc49214aa"; # No tag for nushell 0.104.0 + hash = "sha256-ZQ1zOYcGTfHhRAnDxVxcZ740yF2nccIOWL+yuShhs0Y="; + }; + + useFetchCargoVendor = true; + cargoHash = "sha256-DrHWdwljPsPkzbM9mok5x7gn6Op1ytwg67+HtcZg8G8="; + + nativeBuildInputs = + [ pkg-config ] + ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ writableTmpDirAsHomeHook ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Nushell plugin for sending desktop notifications using notify-rust"; + mainProgram = "nu_plugin_desktop_notifications"; + homepage = "https://github.com/FMotalleb/nu_plugin_desktop_notifications"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ aldenparker ]; + platforms = lib.platforms.all; + }; +}