1 { config, lib, pkgs, ... }:
7 cfg = config.services.fstrim;
14 enable = mkEnableOption (lib.mdDoc "periodic SSD TRIM of mounted partitions in background");
19 description = lib.mdDoc ''
20 How often we run fstrim. For most desktop and server systems
21 a sufficient trimming frequency is once a week.
23 The format is described in
24 {manpage}`systemd.time(7)`.
31 config = mkIf cfg.enable {
33 systemd.packages = [ pkgs.util-linux ];
35 systemd.timers.fstrim = {
37 OnCalendar = cfg.interval;
39 wantedBy = [ "timers.target" ];
44 meta.maintainers = with maintainers; [ ];