nixos/colony: Make fstrim happen right before backup

This commit is contained in:
Jack O'Sullivan 2023-02-21 14:37:39 +00:00
parent 15721e0894
commit c8385a466e
6 changed files with 21 additions and 2 deletions

View File

@ -254,6 +254,11 @@ rec {
}; };
vip1 = "${start.vip1}4/30"; vip1 = "${start.vip1}4/30";
}; };
fstrimConfig = {
enable = true;
# backup happens at 05:00
interval = "04:45";
};
}; };
sshKeyFiles = { sshKeyFiles = {
me = ../.keys/me.pub; me = ../.keys/me.pub;

View File

@ -88,6 +88,7 @@
}; };
services = { services = {
fstrim = lib.my.colony.fstrimConfig;
lvm = { lvm = {
boot.thin.enable = true; boot.thin.enable = true;
dmeventd.enable = true; dmeventd.enable = true;

View File

@ -91,6 +91,7 @@ in
}; };
services = { services = {
fstrim = lib.my.colony.fstrimConfig;
lvm = { lvm = {
dmeventd.enable = true; dmeventd.enable = true;
}; };

View File

@ -92,7 +92,7 @@
}; };
services = { services = {
fstrim.enable = true; fstrim = lib.my.colony.fstrimConfig;
netdata.enable = true; netdata.enable = true;
}; };

View File

@ -93,7 +93,7 @@ in
}; };
services = { services = {
fstrim.enable = true; fstrim = lib.my.colony.fstrimConfig;
netdata.enable = true; netdata.enable = true;
}; };

View File

@ -14,6 +14,18 @@ in
kmscon.autologinUser = mkDefault uname; kmscon.autologinUser = mkDefault uname;
resolved.llmnr = mkDefault "false"; resolved.llmnr = mkDefault "false";
}; };
systemd = {
timers = {
fstrim = mkIf config.services.fstrim.enable {
timerConfig = {
# Upstream unit has these at crazy high values that probably
# make sense on desktops / laptops
AccuracySec = "1min";
RandomizedDelaySec = "5min";
};
};
};
};
my = { my = {
gui.enable = false; gui.enable = false;