nixos/colony: Make fstrim happen right before backup
This commit is contained in:
		@@ -254,6 +254,11 @@ rec {
 | 
			
		||||
      };
 | 
			
		||||
      vip1 = "${start.vip1}4/30";
 | 
			
		||||
    };
 | 
			
		||||
    fstrimConfig = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      # backup happens at 05:00
 | 
			
		||||
      interval = "04:45";
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
  sshKeyFiles = {
 | 
			
		||||
    me = ../.keys/me.pub;
 | 
			
		||||
 
 | 
			
		||||
@@ -88,6 +88,7 @@
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        services = {
 | 
			
		||||
          fstrim = lib.my.colony.fstrimConfig;
 | 
			
		||||
          lvm = {
 | 
			
		||||
            boot.thin.enable = true;
 | 
			
		||||
            dmeventd.enable = true;
 | 
			
		||||
 
 | 
			
		||||
@@ -91,6 +91,7 @@ in
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            services = {
 | 
			
		||||
              fstrim = lib.my.colony.fstrimConfig;
 | 
			
		||||
              lvm = {
 | 
			
		||||
                dmeventd.enable = true;
 | 
			
		||||
              };
 | 
			
		||||
 
 | 
			
		||||
@@ -92,7 +92,7 @@
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            services = {
 | 
			
		||||
              fstrim.enable = true;
 | 
			
		||||
              fstrim = lib.my.colony.fstrimConfig;
 | 
			
		||||
              netdata.enable = true;
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -93,7 +93,7 @@ in
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            services = {
 | 
			
		||||
              fstrim.enable = true;
 | 
			
		||||
              fstrim = lib.my.colony.fstrimConfig;
 | 
			
		||||
              netdata.enable = true;
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -14,6 +14,18 @@ in
 | 
			
		||||
      kmscon.autologinUser = mkDefault uname;
 | 
			
		||||
      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 = {
 | 
			
		||||
      gui.enable = false;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user