2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, formats
|
|
|
|
, systemd
|
|
|
|
}:
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
let
|
|
|
|
ini = formats.ini { };
|
|
|
|
|
|
|
|
unit = ini.generate "systembus-notify.service" {
|
|
|
|
Unit = {
|
|
|
|
Description = "system bus notification daemon";
|
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
|
|
|
Type = "exec";
|
|
|
|
ExecStart = "@out@/bin/systembus-notify";
|
|
|
|
PrivateTmp = true;
|
2024-04-21 15:54:59 +00:00
|
|
|
# NB. We cannot `ProtectHome`, or it would block session dbus access.
|
|
|
|
InaccessiblePaths = "/home";
|
|
|
|
ReadOnlyPaths = "/run/user";
|
2022-03-30 09:31:56 +00:00
|
|
|
ProtectSystem = "strict";
|
|
|
|
Restart = "on-failure";
|
|
|
|
Slice = "background.slice";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
2020-05-29 06:06:01 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "systembus-notify";
|
2020-09-25 04:45:31 +00:00
|
|
|
version = "1.1";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rfjakob";
|
|
|
|
repo = "systembus-notify";
|
|
|
|
rev = "v${version}";
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-WzuBw7LXW54CCMgFE9BSJ2skxaz4IA2BcBny63Ihtt0=";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ systemd ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
install -Dm555 -t $out/bin systembus-notify
|
|
|
|
install -Dm444 -t $out/share/systembus-notify systembus-notify.desktop
|
|
|
|
|
|
|
|
install -d $out/lib/systemd/user
|
|
|
|
substitute ${unit} $out/lib/systemd/user/${unit.name} \
|
|
|
|
--subst-var out
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
# requires a running dbus instance
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-05-29 06:06:01 +00:00
|
|
|
description = "System bus notification daemon";
|
|
|
|
homepage = "https://github.com/rfjakob/systembus-notify";
|
|
|
|
license = licenses.mit;
|
2022-03-30 09:31:56 +00:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2020-05-29 06:06:01 +00:00
|
|
|
platforms = platforms.linux;
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "systembus-notify";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
}
|