default.nix (831B)
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 { 8 lib, 9 pkgs, 10 config, 11 ... 12 }: 13 let 14 inherit (lib) mkOption types; 15 inherit (pkgs) liminix; 16 in 17 { 18 options = { 19 system.service.watchdog = mkOption { 20 type = liminix.lib.types.serviceDefn; 21 }; 22 }; 23 config.system.service.watchdog = config.system.callService ./watchdog.nix { 24 watched = mkOption { 25 description = "services to watch"; 26 type = types.listOf liminix.lib.types.service; 27 }; 28 headStart = mkOption { 29 description = "delay in seconds before watchdog starts checking service health"; 30 default = 60; 31 type = types.int; 32 }; 33 }; 34 config.kernel.config.WATCHDOG = "y"; 35 }