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 {
|
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 ];
|
environment.systemPackages = [ pkgs.irqbalance ];
|
||||||
|
|
||||||
|
systemd.packages = [ pkgs.irqbalance ];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,16 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
LDFLAGS = "-lncurses";
|
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 = {
|
meta = {
|
||||||
homepage = https://github.com/Irqbalance/irqbalance;
|
homepage = https://github.com/Irqbalance/irqbalance;
|
||||||
description = "A daemon to help balance the cpu load generated by interrupts across all of a systems cpus";
|
description = "A daemon to help balance the cpu load generated by interrupts across all of a systems cpus";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user