@@ -1,5 +1,30 @@
1−{ lib, stdenv, fetchFromGitHub, systemd }:
1+{ lib
2+, stdenv
3+, fetchFromGitHub
4+, formats
5+, systemd
6+}:
27
8+let
9+ ini = formats.ini { };
10+
11+ unit = ini.generate "systembus-notify.service" {
12+ Unit = {
13+ Description = "system bus notification daemon";
14+ };
15+
16+ Service = {
17+ Type = "exec";
18+ ExecStart = "@out@/bin/systembus-notify";
19+ PrivateTmp = true;
20+ ProtectHome = true;
21+ ProtectSystem = "strict";
22+ Restart = "on-failure";
23+ Slice = "background.slice";
24+ };
25+ };
26+
27+in
328stdenv.mkDerivation rec {
429 pname = "systembus-notify";
530 version = "1.1";
@@ -8,23 +33,32 @@ stdenv.mkDerivation rec {
833 owner = "rfjakob";
934 repo = "systembus-notify";
1035 rev = "v${version}";
11− sha256 = "1pdn45rfpwhrf20hs87qmk2j8sr7ab8161f81019wnypnb1q2fsv";
36+ sha256 = "sha256-WzuBw7LXW54CCMgFE9BSJ2skxaz4IA2BcBny63Ihtt0=";
1237 };
1338
1439 buildInputs = [ systemd ];
1540
1641 installPhase = ''
1742 runHook preInstall
18− install -Dm755 systembus-notify -t $out/bin
19− install -Dm644 systembus-notify.desktop -t $out/etc/xdg/autostart
43+
44+ install -Dm555 -t $out/bin systembus-notify
45+ install -Dm444 -t $out/share/systembus-notify systembus-notify.desktop
46+
47+ install -d $out/lib/systemd/user
48+ substitute ${unit} $out/lib/systemd/user/${unit.name} \
49+ --subst-var out
50+
2051 runHook postInstall
2152 '';
2253
54+ # requires a running dbus instance
55+ doCheck = false;
56+
2357 meta = with lib; {
2458 description = "System bus notification daemon";
2559 homepage = "https://github.com/rfjakob/systembus-notify";
2660 license = licenses.mit;
61+ maintainers = with maintainers; [ peterhoeg ];
2762 platforms = platforms.linux;
28− maintainers = with maintainers; [];
2963 };
3064}