1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00

nixos/zfs: make zpool-trim timer persistent

If the machine is powered off when the zpool-trim timer is supposed to
trigger (usually around midnight) then the timer will be skipped
outright in favor of the next instance.

For desktop systems which are usually powered off at this time, zpool
trimming will never be run which can degrade SSD performance.

By marking the timer as `Persistent = yes` we ensure that it will run at
the first possible opportunity after the trigger date is reached.
This commit is contained in:
Ivan Petkov 2021-01-15 20:20:23 -08:00
parent 495066a47f
commit e2fa74dc68
No known key found for this signature in database
GPG key ID: BB6F9EFC065832B6

View file

@ -664,6 +664,8 @@ in
# - There are only HDDs and we would set the system in a degraded state
serviceConfig.ExecStart = ''${pkgs.runtimeShell} -c 'for pool in $(zpool list -H -o name); do zpool trim $pool; done || true' '';
};
systemd.timers.zpool-trim.timerConfig.Persistent = "yes";
})
];
}