diff options
Diffstat (limited to 'modules/nixos/personal')
| -rw-r--r-- | modules/nixos/personal/nix.nix | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/nixos/personal/nix.nix b/modules/nixos/personal/nix.nix index 6f68f60..0d17148 100644 --- a/modules/nixos/personal/nix.nix +++ b/modules/nixos/personal/nix.nix @@ -8,14 +8,16 @@ hasFlake = cfg.flake != null; hasFlakeInputs = cfg.autoUpgrade.autoUpdateInputs != []; checkNetwork = { - preStart = "${pkgs.host}/bin/host 9.9.9.9 || kill -s SIGUSR1 $$"; # Check network connectivity + path = [pkgs.host]; + # Check network connectivity + preStart = "(${lib.concatMapStringsSep " && " (host: "host ${host}") cfg.autoUpgrade.checkHosts}) || kill -s SIGUSR1 $$"; unitConfig = { StartLimitIntervalSec = 300; StartLimitBurst = 5; }; serviceConfig = { Restart = "on-abort"; - RestartSec = "30"; + RestartSec = 30; }; }; in { @@ -27,6 +29,10 @@ in { type = with lib.types; listOf str; default = ["nixpkgs"]; }; + checkHosts = lib.mkOption { + type = with lib.types; listOf str; + default = ["cache.nixos.org"]; + }; }; flake = lib.mkOption { type = with lib.types; nullOr str; |
