mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 18:03:04 +00:00
423545fe48
now nix-doc-munge will not introduce whitespace changes when it replaces manpage references with the MD equivalent. no change to the manpage, changes to the HTML manual are whitespace only.
46 lines
897 B
Nix
46 lines
897 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.fstrim;
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
services.fstrim = {
|
|
enable = mkEnableOption "periodic SSD TRIM of mounted partitions in background";
|
|
|
|
interval = mkOption {
|
|
type = types.str;
|
|
default = "weekly";
|
|
description = ''
|
|
How often we run fstrim. For most desktop and server systems
|
|
a sufficient trimming frequency is once a week.
|
|
|
|
The format is described in
|
|
<citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
|
|
'';
|
|
};
|
|
};
|
|
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.packages = [ pkgs.util-linux ];
|
|
|
|
systemd.timers.fstrim = {
|
|
timerConfig = {
|
|
OnCalendar = cfg.interval;
|
|
};
|
|
wantedBy = [ "timers.target" ];
|
|
};
|
|
|
|
};
|
|
|
|
meta.maintainers = with maintainers; [ ];
|
|
}
|