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;
in
{
options.programs.oddjobd = {
enable = lib.mkEnableOption "oddjob";
package = lib.mkPackageOption pkgs "oddjob" {};
options = {
programs.oddjobd = {
enable = lib.mkEnableOption "oddjob";
package = lib.mkPackageOption pkgs "oddjob" {};
};
};
config = lib.mkIf cfg.enable {
systemd.packages = [ cfg.package ];
systemd.services.oddjobd = {
wantedBy = [ "multi-user.target"];
after = [ "network.target"];
wantedBy = [ "multi-user.target" ];
after = [ "network.target" "dbus.service" ];
description = "DBUS Odd-job Daemon";
enable = true;
documentation = [ "man:oddjobd(8)" "man:oddjobd.conf(5)" ];
serviceConfig = {
Type = "dbus";
BusName = "org.freedesktop.oddjob";
ExecStart = "${lib.getBin cfg.package}/bin/oddjobd";
Type = "simple";
PIDFile = "/run/oddjobd.pid";
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 ];