mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #53444 from wedens/earlyoom-notifications
nixos/earlyoom: add notificationsCommand option
This commit is contained in:
commit
9cda3faecd
1 changed files with 14 additions and 1 deletions
|
@ -63,6 +63,17 @@ in
|
||||||
Enable debugging messages.
|
Enable debugging messages.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
notificationsCommand = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
example = "sudo -u example_user DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send";
|
||||||
|
description = ''
|
||||||
|
Command used to send notifications.
|
||||||
|
|
||||||
|
See <link xlink:href="https://github.com/rfjakob/earlyoom#notifications">README</link> for details.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -88,7 +99,9 @@ in
|
||||||
-s ${toString ecfg.freeSwapThreshold} \
|
-s ${toString ecfg.freeSwapThreshold} \
|
||||||
${optionalString ecfg.useKernelOOMKiller "-k"} \
|
${optionalString ecfg.useKernelOOMKiller "-k"} \
|
||||||
${optionalString ecfg.ignoreOOMScoreAdjust "-i"} \
|
${optionalString ecfg.ignoreOOMScoreAdjust "-i"} \
|
||||||
${optionalString ecfg.enableDebugInfo "-d"}
|
${optionalString ecfg.enableDebugInfo "-d"} \
|
||||||
|
${optionalString (ecfg.notificationsCommand != null)
|
||||||
|
"-N ${escapeShellArg ecfg.notificationsCommand}"}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue