2021-07-12 09:34:26 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, formats
|
|
|
|
, systemd
|
|
|
|
}:
|
2020-05-24 17:46:22 +02:00
|
|
|
|
2021-07-12 09:34:26 +02: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;
|
|
|
|
ProtectHome = true;
|
|
|
|
ProtectSystem = "strict";
|
|
|
|
Restart = "on-failure";
|
|
|
|
Slice = "background.slice";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
2020-05-24 17:46:22 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "systembus-notify";
|
2020-08-24 11:38:53 +02:00
|
|
|
version = "1.1";
|
2020-05-24 17:46:22 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rfjakob";
|
|
|
|
repo = "systembus-notify";
|
|
|
|
rev = "v${version}";
|
2021-07-12 09:34:26 +02:00
|
|
|
sha256 = "sha256-WzuBw7LXW54CCMgFE9BSJ2skxaz4IA2BcBny63Ihtt0=";
|
2020-05-24 17:46:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ systemd ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2021-07-12 09:34:26 +02: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-24 17:46:22 +02:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-07-12 09:34:26 +02:00
|
|
|
# requires a running dbus instance
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-05-24 17:46:22 +02:00
|
|
|
description = "System bus notification daemon";
|
|
|
|
homepage = "https://github.com/rfjakob/systembus-notify";
|
|
|
|
license = licenses.mit;
|
2021-07-12 09:34:26 +02:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2020-05-24 17:46:22 +02:00
|
|
|
platforms = platforms.linux;
|
2024-02-11 03:19:15 +01:00
|
|
|
mainProgram = "systembus-notify";
|
2020-05-24 17:46:22 +02:00
|
|
|
};
|
|
|
|
}
|