From 60bf958aea5cabc75c310fbf4dbf4cb986f8c0ba Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 6 May 2026 15:23:04 +0200 Subject: [PATCH] ntfy-sh: fix `sh` not found in subscribe command ntfy's CLI supports running a command for every incoming message via: ntfy subscribe TOPIC COMMAND See: https://docs.ntfy.sh/subscribe/cli/#run-command-for-every-message The upstream source hardcodes `sh` as the script launcher in `cmd/subscribe_unix.go` and `cmd/subscribe_darwin.go`: ```go scriptLauncher = []string{"sh", "-c"} ``` On NixOS, `sh` is not available in $PATH, causing command execution to fail with: Command failed: exec: "sh": executable file not found in $PATH Replace the hardcoded `sh` with nixpkgs' runtimeShell, which resolves to the system's configured shell (typically bash). --- pkgs/by-name/nt/ntfy-sh/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/nt/ntfy-sh/package.nix b/pkgs/by-name/nt/ntfy-sh/package.nix index 6f90ad89499c..cb0a87b9a74e 100644 --- a/pkgs/by-name/nt/ntfy-sh/package.nix +++ b/pkgs/by-name/nt/ntfy-sh/package.nix @@ -8,6 +8,7 @@ mkdocs, python3, python3Packages, + runtimeShell, }: buildGoModule ( @@ -71,6 +72,12 @@ buildGoModule ( postPatch = '' sed -i 's# /bin/echo# echo#' Makefile + substituteInPlace \ + cmd/subscribe_unix.go \ + cmd/subscribe_darwin.go \ + --replace \ + 'scriptLauncher = []string{"sh", "-c"}' \ + 'scriptLauncher = []string{"${runtimeShell}", "-c"}' ''; preBuild = ''