default.nix (817B)
1 ## Watchdog 2 ## 3 ## Enable hardware watchdog (for devices that support one) and 4 ## feed it by checking the health of specified critical services. 5 ## If the watchdog feeder stops, the device will reboot. 6 7 { lib, pkgs, config, ...}: 8 let 9 inherit (lib) mkOption types; 10 inherit (pkgs) liminix; 11 in 12 { 13 options = { 14 system.service.watchdog = mkOption { 15 type = liminix.lib.types.serviceDefn; 16 }; 17 }; 18 config.system.service.watchdog = liminix.callService ./watchdog.nix { 19 watched = mkOption { 20 description = "services to watch"; 21 type = types.listOf liminix.lib.types.service; 22 }; 23 headStart = mkOption { 24 description = "delay in seconds before watchdog starts checking service health"; 25 default = 60; 26 type = types.int; 27 }; 28 }; 29 config.kernel.config.WATCHDOG = "y"; 30 }