create derivation for notify-send.py

It's a more fully-featured client than libnotify's notify-send: we
don't need to install it but it's handly for testing the server
phoen
Daniel Barlow 2022-02-12 16:08:56 +00:00
parent 7824d42be7
commit 731e59f8fe
1 changed files with 32 additions and 0 deletions

32
crier/notify-send.nix Normal file
View File

@ -0,0 +1,32 @@
# notify-send.py is not needed for installation but it's
# handy for testing, as it supports more features of the
# notification protocol than the basic notify-send.
#
# https://wiki.archlinux.org/title/Desktop_notifications#Tips_and_tricks
#
# Getting it to build in nixpkgs was fun: it requires the
# deprecated dbus-notify library, which doesn't play nice with
# standard Python tooling
{ pkgs, lib, dbus, fetchpatch, fetchFromGitHub, python38Packages }:
python38Packages.buildPythonApplication rec {
pname = "notify-send";
version = "git";
format = "pyproject";
src = fetchFromGitHub {
owner = "phuhl";
repo = "notify-send.py";
rev = "0575c79f10d10892c41559dd3695346d16a8b184";
hash = "sha256:09m15h1yja5x2ihrp92ab3q220mgdcb0k4ld00dccn4krzcn3a7v";
};
patchPhase = ''
sed -i pyproject.toml -e 's/"dbus-python",//'
'';
propagatedBuildInputs = with python38Packages; [
dbus-python pygobject3 setuptools flit pip
];
}