summary refs log tree commit diff
path: root/pkgs/os-specific/linux/earlyoom
diff options
context:
space:
mode:
authoroxalica <oxalicc@pm.me>2020-05-25 23:13:55 +0800
committerGitHub <noreply@github.com>2020-05-25 10:13:55 -0500
commitfe3e52c29154d8b8549f58dbd296ba373b7b803d (patch)
tree7c708676dadd94e788d2aaf06aabd18401b77919 /pkgs/os-specific/linux/earlyoom
parentf1d9510c991daad405ce17f5a4ca38b2db5146a9 (diff)
downloadnixpkgs-fe3e52c29154d8b8549f58dbd296ba373b7b803d.tar
nixpkgs-fe3e52c29154d8b8549f58dbd296ba373b7b803d.tar.gz
nixpkgs-fe3e52c29154d8b8549f58dbd296ba373b7b803d.tar.bz2
nixpkgs-fe3e52c29154d8b8549f58dbd296ba373b7b803d.tar.lz
nixpkgs-fe3e52c29154d8b8549f58dbd296ba373b7b803d.tar.xz
nixpkgs-fe3e52c29154d8b8549f58dbd296ba373b7b803d.tar.zst
nixpkgs-fe3e52c29154d8b8549f58dbd296ba373b7b803d.zip
earlyoom: patch absolute dbus path and make nixos module up to date (#88443)
* earlyoom: patch absolute path of dbus-send

* nixos/earlyoom: replace `notificationsCommand` with `enableNotification`

* nixos/earlyoom: setup `systembus-notify` when `enableNotification`
Diffstat (limited to 'pkgs/os-specific/linux/earlyoom')
-rw-r--r--pkgs/os-specific/linux/earlyoom/default.nix2
-rw-r--r--pkgs/os-specific/linux/earlyoom/fix-dbus-path.patch11
2 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/earlyoom/default.nix b/pkgs/os-specific/linux/earlyoom/default.nix
index 2e0f5ef7833..8233c065c2b 100644
--- a/pkgs/os-specific/linux/earlyoom/default.nix
+++ b/pkgs/os-specific/linux/earlyoom/default.nix
@@ -13,6 +13,8 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = stdenv.lib.optionals withManpage [ pandoc installShellFiles ];
 
+  patches = [ ./fix-dbus-path.patch ];
+
   makeFlags = [ "VERSION=${version}" ];
 
   installPhase = ''
diff --git a/pkgs/os-specific/linux/earlyoom/fix-dbus-path.patch b/pkgs/os-specific/linux/earlyoom/fix-dbus-path.patch
new file mode 100644
index 00000000000..e1c10cf82f9
--- /dev/null
+++ b/pkgs/os-specific/linux/earlyoom/fix-dbus-path.patch
@@ -0,0 +1,11 @@
+--- a/kill.c
++++ b/kill.c
+@@ -55,7 +55,7 @@ static void notify(const char* summary, const char* body)
+     }
+     // Complete command line looks like this:
+     // dbus-send --system / net.nuetzlich.SystemNotifications.Notify 'string:summary text' 'string:and body text'
+-    execl("/usr/bin/dbus-send", "dbus-send", "--system", "/", "net.nuetzlich.SystemNotifications.Notify",
++    execlp("dbus-send", "dbus-send", "--system", "/", "net.nuetzlich.SystemNotifications.Notify",
+         summary2, body2, NULL);
+     warn("notify: exec failed: %s\n", strerror(errno));
+     exit(1);