Skip to content

Conversation

@pitkling
Copy link
Member

@pitkling pitkling commented Jan 9, 2026

Apprise supports desktop notifications on macOS (e.g., via apprise -b "Hello World" "macosx://"). This feature uses terminal-notifier under the hood. Unfortunately, the potential paths to terminal-notifier are hardcoded into apprise. Thus, nixpkgs's apprise does currently not support desktop notifications on macOS.

This PR adds the terminal-notifier dependency under macOS and patches the hardcoded paths to use nixpkgs's terminal-notifier.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Jan 9, 2026
@pitkling pitkling force-pushed the fixes/apprise-macos-support branch from bedc1ff to 43ea6b7 Compare January 9, 2026 11:15
@nixpkgs-ci nixpkgs-ci bot requested a review from getchoo January 9, 2026 11:21
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 6.topic: python Python is a high-level, general-purpose programming language. labels Jan 9, 2026
@pitkling
Copy link
Member Author

pitkling commented Jan 9, 2026

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 478344
Commit: 43ea6b7e2e42c7637098f72b77b4a8e983569dc0


aarch64-darwin

✅ 19 packages built:
  • apprise (python313Packages.apprise)
  • apprise.dist (python313Packages.apprise.dist)
  • borgmatic
  • borgmatic.dist
  • changedetection-io
  • changedetection-io.dist
  • healthchecks
  • mealie
  • mealie.dist
  • moonraker
  • pinchflat
  • prefect (python313Packages.prefect, python314Packages.prefect)
  • prefect.dist (python313Packages.prefect.dist, python314Packages.prefect.dist)
  • prometheus-borgmatic-exporter
  • prometheus-borgmatic-exporter.dist
  • python314Packages.apprise
  • python314Packages.apprise.dist
  • unifi-protect-backup
  • unifi-protect-backup.dist

patches = lib.optionals stdenv.hostPlatform.isDarwin [
(replaceVars ./add-terminal-notifier-path.patch {
terminalNotifierPath = "${lib.getExe' terminal-notifier "terminal-notifier"}";
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Substituting the first path is probably a better idea. Applying patch only on darwin risks being ignored during updates.

Copy link
Member Author

@pitkling pitkling Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a look!

Substituting the first path is probably a better idea.during updates.

Good point, I now just insert the nix path at the first position of the list.

Applying patch only on darwin risks being ignored

The patch is now applied for all platforms. I wasn't sure whether applying this unconditionally would pull in the dependency also under Linux (where terminal-notifier is not available).

@pitkling pitkling force-pushed the fixes/apprise-macos-support branch from 43ea6b7 to 2ad4bff Compare January 10, 2026 14:08
(replaceVars ./add-terminal-notifier-path.patch {
terminalNotifierPath = "${lib.getExe' terminal-notifier "terminal-notifier"}";
})
];
Copy link
Member

@Aleksanaa Aleksanaa Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
];
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace apprise/plugins/macosx.py \
--replace-fail "/opt/homebrew/bin/terminal-notifier" "${lib.getExe' terminal-notifier "terminal-notifier"}"
'';

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, sorry for the misunderstanding. I'm now using the substitute instead of the patch.

@pitkling pitkling force-pushed the fixes/apprise-macos-support branch 2 times, most recently from 4d39176 to a6d5eee Compare January 10, 2026 16:32
Comment on lines 56 to 58
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
terminal-notifier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
terminal-notifier

It's not needed as you have set absolute path. And this "dependencies" corresponds to pyproject's, which is only related to python modules.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for the tip! :)

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jan 10, 2026
Apprise supports desktop notifications on macOS (e.g., via `apprise -b "Hello World" "macosx://"`). This feature uses terminal-notifier under the hood. Unfortunately, the potential paths to terminal-notifier are hardcoded into apprise. Thus, nixpkgs's apprise does currently not support desktop notifications on macOS.

This PR adds the terminal-notifier dependency under macOS and patches the hardcoded paths to use nixpkgs's terminal-notifier.
@pitkling pitkling force-pushed the fixes/apprise-macos-support branch from a6d5eee to 3e99122 Compare January 10, 2026 16:44
@Aleksanaa
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 478344
Commit: 3e991220051d642453df3a64ee5d7aa805187491 (subsequent changes)
Merge: 715ca61bf5c06cd6dcf79bb3320997aa145fd500

Logs: https://github.com/Aleksanaa/nixpkgs-review-gha/actions/runs/20888219643


x86_64-darwin (sandbox = relaxed)

❌ 3 packages failed to build:
  • pinchflat
  • prometheus-borgmatic-exporter
  • prometheus-borgmatic-exporter.dist
✅ 16 packages built:
  • apprise (python313Packages.apprise)
  • apprise.dist (python313Packages.apprise.dist)
  • borgmatic
  • borgmatic.dist
  • changedetection-io
  • changedetection-io.dist
  • healthchecks
  • mealie
  • mealie.dist
  • moonraker
  • prefect (python313Packages.prefect, python314Packages.prefect)
  • prefect.dist (python313Packages.prefect.dist, python314Packages.prefect.dist)
  • python314Packages.apprise
  • python314Packages.apprise.dist
  • unifi-protect-backup
  • unifi-protect-backup.dist

Error logs: `x86_64-darwin`
pinchflat
    (public_key 1.20) pubkey_os_cacerts.erl:56: :pubkey_os_cacerts.get/0
    (esbuild 0.10.0) lib/esbuild/npm_registry.ex:101: Esbuild.NpmRegistry.do_fetch/1
    (esbuild 0.10.0) lib/esbuild/npm_registry.ex:67: Esbuild.NpmRegistry.fetch_file!/2
    (esbuild 0.10.0) lib/esbuild/npm_registry.ex:46: Esbuild.NpmRegistry.fetch_package!/2
    (esbuild 0.10.0) lib/esbuild.ex:241: Esbuild.install/0
    (elixir 1.18.4) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: #Function<1.110144940/0 in Esbuild.install>
    Args: []

03:14:00.747 [debug] Downloading esbuild from https://registry.npmjs.org/@esbuild/darwin-x64/0.17.11
** (ErlangError) Erlang error: :enoent
:erlang.open_port({:spawn_executable, ~c"/nix/build/nix-18042-426273727/source/_build/esbuild-darwin-x64"}, [:use_stdio, :stderr_to_stdout, {:env, [{~c"NODE_PATH", ~c"/nix/build/nix-18042-426273727/source/deps"}]}, {:cd, "/nix/build/nix-18042-426273727/source/assets"}, :exit_status, :binary, :hide, {:args, ["js/app.js", "--bundle", "--target=es2017", "--outdir=../priv/static/assets", "--external:/fonts/", "--external:/images/", "--minify"]}])
(elixir 1.18.4) lib/system.ex:1131: System.do_cmd/3
(esbuild 0.10.0) lib/esbuild.ex:184: Esbuild.run/2
(esbuild 0.10.0) lib/mix/tasks/esbuild.ex:56: Mix.Tasks.Esbuild.install_and_run/1
(mix 1.18.4) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
(elixir 1.18.4) lib/enum.ex:987: Enum."-each/2-lists^foreach/1-0-"/2
(mix 1.18.4) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.18.4) lib/mix/cli.ex:107: Mix.CLI.run_task/2
erl_child_setup: failed with error 32 on line 284

prometheus-borgmatic-exporter
      )
    File "/nix/store/pf95p3q4sfybf2k8qnmf11jh320s7v8l-python3.13-waitress-3.0.2/lib/python3.13/site-packages/waitress/server.py", line 243, in __init__
      self.bind_server_socket()
      ~~~~~~~~~~~~~~~~~~~~~~~^^
    File "/nix/store/pf95p3q4sfybf2k8qnmf11jh320s7v8l-python3.13-waitress-3.0.2/lib/python3.13/site-packages/waitress/server.py", line 364, in bind_server_socket
      self.bind(sockaddr)
      ~~~~~~~~~^^^^^^^^^^
    File "/nix/store/pf95p3q4sfybf2k8qnmf11jh320s7v8l-python3.13-waitress-3.0.2/lib/python3.13/site-packages/waitress/wasyncore.py", line 374, in bind
      return self.socket.bind(addr)
             ~~~~~~~~~~~~~~~~^^^^^^
  PermissionError: [Errno 1] Operation not permitted

Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_http.py::test_metrics_endpoint - requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', p...
=================== 1 failed, 26 passed, 1 warning in 1.76s ====================


aarch64-darwin (sandbox = relaxed)

❌ 3 packages failed to build:
  • pinchflat
  • prometheus-borgmatic-exporter
  • prometheus-borgmatic-exporter.dist
✅ 16 packages built:
  • apprise (python313Packages.apprise)
  • apprise.dist (python313Packages.apprise.dist)
  • borgmatic
  • borgmatic.dist
  • changedetection-io
  • changedetection-io.dist
  • healthchecks
  • mealie
  • mealie.dist
  • moonraker
  • prefect (python313Packages.prefect, python314Packages.prefect)
  • prefect.dist (python313Packages.prefect.dist, python314Packages.prefect.dist)
  • python314Packages.apprise
  • python314Packages.apprise.dist
  • unifi-protect-backup
  • unifi-protect-backup.dist

Error logs: `aarch64-darwin`
pinchflat
    (public_key 1.20) pubkey_os_cacerts.erl:301: :pubkey_os_cacerts.conv_error_reason(:no_cacerts_found)
    (public_key 1.20) pubkey_os_cacerts.erl:56: :pubkey_os_cacerts.get/0
    (esbuild 0.10.0) lib/esbuild/npm_registry.ex:101: Esbuild.NpmRegistry.do_fetch/1
    (esbuild 0.10.0) lib/esbuild/npm_registry.ex:67: Esbuild.NpmRegistry.fetch_file!/2
    (esbuild 0.10.0) lib/esbuild/npm_registry.ex:46: Esbuild.NpmRegistry.fetch_package!/2
    (esbuild 0.10.0) lib/esbuild.ex:241: Esbuild.install/0
    (elixir 1.18.4) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: #Function<1.110144940/0 in Esbuild.install>
    Args: []

02:52:14.271 [debug] Downloading esbuild from https://registry.npmjs.org/@esbuild/darwin-arm64/0.17.11
** (ErlangError) Erlang error: :enoent
:erlang.open_port({:spawn_executable, ~c"/nix/build/nix-11156-3818307235/source/_build/esbuild-darwin-arm64"}, [:use_stdio, :stderr_to_stdout, {:env, [{~c"NODE_PATH", ~c"/nix/build/nix-11156-3818307235/source/deps"}]}, {:cd, "/nix/build/nix-11156-3818307235/source/assets"}, :exit_status, :binary, :hide, {:args, ["js/app.js", "--bundle", "--target=es2017", "--outdir=../priv/static/assets", "--external:/fonts/", "--external:/images/", "--minify"]}])
(elixir 1.18.4) lib/system.ex:1131: System.do_cmd/3
(esbuild 0.10.0) lib/esbuild.ex:184: Esbuild.run/2
(esbuild 0.10.0) lib/mix/tasks/esbuild.ex:56: Mix.Tasks.Esbuild.install_and_run/1
(mix 1.18.4) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
(elixir 1.18.4) lib/enum.ex:987: Enum."-each/2-lists^foreach/1-0-"/2
(mix 1.18.4) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.18.4) lib/mix/cli.ex:107: Mix.CLI.run_task/2

prometheus-borgmatic-exporter
      )
    File "/nix/store/jzkjif7mlsn4mqd3pxq6mzjzhc0mgkzs-python3.13-waitress-3.0.2/lib/python3.13/site-packages/waitress/server.py", line 243, in __init__
      self.bind_server_socket()
      ~~~~~~~~~~~~~~~~~~~~~~~^^
    File "/nix/store/jzkjif7mlsn4mqd3pxq6mzjzhc0mgkzs-python3.13-waitress-3.0.2/lib/python3.13/site-packages/waitress/server.py", line 364, in bind_server_socket
      self.bind(sockaddr)
      ~~~~~~~~~^^^^^^^^^^
    File "/nix/store/jzkjif7mlsn4mqd3pxq6mzjzhc0mgkzs-python3.13-waitress-3.0.2/lib/python3.13/site-packages/waitress/wasyncore.py", line 374, in bind
      return self.socket.bind(addr)
             ~~~~~~~~~~~~~~~~^^^^^^
  PermissionError: [Errno 1] Operation not permitted

Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_http.py::test_metrics_endpoint - requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', p...
=================== 1 failed, 26 passed, 1 warning in 1.33s ====================

@Aleksanaa Aleksanaa added this pull request to the merge queue Jan 11, 2026
Merged via the queue into NixOS:master with commit c5ededd Jan 11, 2026
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants