spread nix store optimiser over time
This commit is contained in:
parent
6625e9c1f3
commit
568c968ca8
11 changed files with 18 additions and 13 deletions
|
|
@ -1,13 +1,9 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
randomHour = import ../lib/randomHour.nix { inherit lib; };
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
nix = {
|
nix = {
|
||||||
optimise = {
|
optimise = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
dates = [ "${toString randomHour config.networking.hostName}:00" ];
|
|
||||||
};
|
};
|
||||||
settings = {
|
settings = {
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,7 @@
|
||||||
../../services/openssh.nix
|
../../services/openssh.nix
|
||||||
../../services/etcd.nix
|
../../services/etcd.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nix.optimise.dates = [ "01:00" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,7 @@
|
||||||
../../services/openssh.nix
|
../../services/openssh.nix
|
||||||
../../services/etcd.nix
|
../../services/etcd.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nix.optimise.dates = [ "02:00" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,7 @@
|
||||||
../../services/openssh.nix
|
../../services/openssh.nix
|
||||||
../../services/etcd.nix
|
../../services/etcd.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nix.optimise.dates = [ "03:00" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@
|
||||||
../../services/openssh.nix
|
../../services/openssh.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nix.optimise.dates = [ "00:00" ];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [ "ahci" "xhci_pci" "ehci_pci" "megaraid_sas" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
|
initrd.availableKernelModules = [ "ahci" "xhci_pci" "ehci_pci" "megaraid_sas" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
|
||||||
kernelModules = [ "kvm-intel" ];
|
kernelModules = [ "kvm-intel" ];
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,7 @@
|
||||||
../../services/openssh.nix
|
../../services/openssh.nix
|
||||||
../../services/etcd.nix
|
../../services/etcd.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nix.optimise.dates = [ "04:00" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,7 @@
|
||||||
../../services/openssh.nix
|
../../services/openssh.nix
|
||||||
../../services/etcd.nix
|
../../services/etcd.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nix.optimise.dates = [ "05:00" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,7 @@
|
||||||
../../services/openssh.nix
|
../../services/openssh.nix
|
||||||
../../services/etcd.nix
|
../../services/etcd.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nix.optimise.dates = [ "06:00" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,7 @@
|
||||||
../../services/openssh.nix
|
../../services/openssh.nix
|
||||||
../../services/etcd.nix
|
../../services/etcd.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nix.optimise.dates = [ "07:00" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,7 @@
|
||||||
../../services/openssh.nix
|
../../services/openssh.nix
|
||||||
../../services/etcd.nix
|
../../services/etcd.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nix.optimise.dates = [ "08:00" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue