nixos/oddjobd: enable oddjob dbus service

This commit is contained in:
Anthony Roussel 2024-04-06 23:42:02 +02:00
parent b0f78fba37
commit 9a03f2ca13
No known key found for this signature in database
GPG key ID: 9DC4987B1A55E75E

View file

@ -4,26 +4,28 @@ let
cfg = config.programs.oddjobd; cfg = config.programs.oddjobd;
in in
{ {
options.programs.oddjobd = { options = {
programs.oddjobd = {
enable = lib.mkEnableOption "oddjob"; enable = lib.mkEnableOption "oddjob";
package = lib.mkPackageOption pkgs "oddjob" {}; package = lib.mkPackageOption pkgs "oddjob" {};
}; };
};
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
systemd.packages = [ cfg.package ];
systemd.services.oddjobd = { systemd.services.oddjobd = {
wantedBy = [ "multi-user.target"]; wantedBy = [ "multi-user.target" ];
after = [ "network.target"]; after = [ "network.target" "dbus.service" ];
description = "DBUS Odd-job Daemon"; description = "DBUS Odd-job Daemon";
enable = true; enable = true;
documentation = [ "man:oddjobd(8)" "man:oddjobd.conf(5)" ]; documentation = [ "man:oddjobd(8)" "man:oddjobd.conf(5)" ];
serviceConfig = { serviceConfig = {
Type = "dbus"; Type = "simple";
BusName = "org.freedesktop.oddjob"; PIDFile = "/run/oddjobd.pid";
ExecStart = "${lib.getBin cfg.package}/bin/oddjobd"; ExecStart = "${lib.getBin cfg.package}/bin/oddjobd -n -p /run/oddjobd.pid -t 300";
}; };
}; };
services.dbus.packages = [ cfg.package ];
}; };
meta.maintainers = with lib.maintainers; [ SohamG ]; meta.maintainers = with lib.maintainers; [ SohamG ];