diff --git a/hosts/common.nix b/hosts/common.nix index 81c429b..15eed06 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -1,13 +1,9 @@ { config, lib, pkgs, ... }: -let - randomHour = import ../lib/randomHour.nix { inherit lib; }; -in { nix = { optimise = { automatic = true; - dates = [ "${toString randomHour config.networking.hostName}:00" ]; }; settings = { auto-optimise-store = true; diff --git a/hosts/control-plane-01/default.nix b/hosts/control-plane-01/default.nix index 794576f..7939593 100644 --- a/hosts/control-plane-01/default.nix +++ b/hosts/control-plane-01/default.nix @@ -7,5 +7,7 @@ ../../services/openssh.nix ../../services/etcd.nix ]; + + nix.optimise.dates = [ "01:00" ]; } diff --git a/hosts/control-plane-02/default.nix b/hosts/control-plane-02/default.nix index 794576f..00342a7 100644 --- a/hosts/control-plane-02/default.nix +++ b/hosts/control-plane-02/default.nix @@ -7,5 +7,7 @@ ../../services/openssh.nix ../../services/etcd.nix ]; + + nix.optimise.dates = [ "02:00" ]; } diff --git a/hosts/control-plane-03/default.nix b/hosts/control-plane-03/default.nix index 794576f..93a191e 100644 --- a/hosts/control-plane-03/default.nix +++ b/hosts/control-plane-03/default.nix @@ -7,5 +7,7 @@ ../../services/openssh.nix ../../services/etcd.nix ]; + + nix.optimise.dates = [ "03:00" ]; } diff --git a/hosts/kaede/default.nix b/hosts/kaede/default.nix index 8469dc8..11d81b3 100644 --- a/hosts/kaede/default.nix +++ b/hosts/kaede/default.nix @@ -6,6 +6,8 @@ ../../services/openssh.nix ]; + nix.optimise.dates = [ "00:00" ]; + boot = { initrd.availableKernelModules = [ "ahci" "xhci_pci" "ehci_pci" "megaraid_sas" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; kernelModules = [ "kvm-intel" ]; diff --git a/hosts/worker-01/default.nix b/hosts/worker-01/default.nix index 794576f..97fcc13 100644 --- a/hosts/worker-01/default.nix +++ b/hosts/worker-01/default.nix @@ -7,5 +7,7 @@ ../../services/openssh.nix ../../services/etcd.nix ]; + + nix.optimise.dates = [ "04:00" ]; } diff --git a/hosts/worker-02/default.nix b/hosts/worker-02/default.nix index 794576f..71ccf0a 100644 --- a/hosts/worker-02/default.nix +++ b/hosts/worker-02/default.nix @@ -7,5 +7,7 @@ ../../services/openssh.nix ../../services/etcd.nix ]; + + nix.optimise.dates = [ "05:00" ]; } diff --git a/hosts/worker-03/default.nix b/hosts/worker-03/default.nix index 794576f..952ce5b 100644 --- a/hosts/worker-03/default.nix +++ b/hosts/worker-03/default.nix @@ -7,5 +7,7 @@ ../../services/openssh.nix ../../services/etcd.nix ]; + + nix.optimise.dates = [ "06:00" ]; } diff --git a/hosts/worker-04/default.nix b/hosts/worker-04/default.nix index 794576f..bb4089f 100644 --- a/hosts/worker-04/default.nix +++ b/hosts/worker-04/default.nix @@ -7,5 +7,7 @@ ../../services/openssh.nix ../../services/etcd.nix ]; + + nix.optimise.dates = [ "07:00" ]; } diff --git a/hosts/worker-05/default.nix b/hosts/worker-05/default.nix index 794576f..23b5991 100644 --- a/hosts/worker-05/default.nix +++ b/hosts/worker-05/default.nix @@ -7,5 +7,7 @@ ../../services/openssh.nix ../../services/etcd.nix ]; + + nix.optimise.dates = [ "08:00" ]; } diff --git a/lib/randomHour.nix b/lib/randomHour.nix deleted file mode 100644 index 628f8c9..0000000 --- a/lib/randomHour.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ lib }: -hostname: - -let - hash = builtins.hashString "sha256" hostname; - n = lib.strings.toIntBase 16 (builtins.substring 0 8 hash); -in - n % 24 -