Add 'legacy/server-config/' from commit '4bc5d57fa69a393877e7019d7673ceb33c3ab4b4'
git-subtree-dir: legacy/server-config git-subtree-mainline:dc481c24b0git-subtree-split:4bc5d57fa6
This commit is contained in:
22
legacy/server-config/services/ups.nix
Normal file
22
legacy/server-config/services/ups.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.apcupsd = {
|
||||
enable = true;
|
||||
configText = ''
|
||||
UPSTYPE usb
|
||||
NISIP 127.0.0.1
|
||||
BATTERYLEVEL 5 # shutdown after reaching 5% battery
|
||||
MINUTES 5 # shutdown if estimated runtime on battery reaches 5 minutes
|
||||
'';
|
||||
|
||||
hooks = {
|
||||
# command to run when shutdown condition is met
|
||||
doshutdown = "systemctl poweroff";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user