irqbalance: using systemd service definition from the package itself
This commit is contained in:
parent
a5ab947003
commit
04bfeeac79
|
@ -13,25 +13,10 @@ in
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
systemd.services = {
|
||||
irqbalance = {
|
||||
description = "irqbalance daemon";
|
||||
path = [ pkgs.irqbalance ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.irqbalance}/bin/irqbalance --foreground";
|
||||
CapabilityBoundingSet = "";
|
||||
NoNewPrivileges = "yes";
|
||||
ReadOnlyPaths = "/";
|
||||
ReadWritePaths = "/proc/irq";
|
||||
RestrictAddressFamilies = "AF_UNIX";
|
||||
RuntimeDirectory = "irqbalance/";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.irqbalance ];
|
||||
|
||||
systemd.packages = [ pkgs.irqbalance ];
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,16 @@ stdenv.mkDerivation rec {
|
|||
|
||||
LDFLAGS = "-lncurses";
|
||||
|
||||
postInstall =
|
||||
''
|
||||
# Systemd service
|
||||
mkdir -p $out/lib/systemd/system
|
||||
grep -vi "EnvironmentFile" misc/irqbalance.service >$out/lib/systemd/system/irqbalance.service
|
||||
substituteInPlace $out/lib/systemd/system/irqbalance.service \
|
||||
--replace /usr/sbin/irqbalance $out/bin/irqbalance \
|
||||
--replace ' $IRQBALANCE_ARGS' ""
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = https://github.com/Irqbalance/irqbalance;
|
||||
description = "A daemon to help balance the cpu load generated by interrupts across all of a systems cpus";
|
||||
|
|
Loading…
Reference in New Issue