diff --git a/system/modules/hardware/ssd/default.nix b/system/modules/hardware/ssd/default.nix new file mode 100644 index 0000000..a0696fc --- /dev/null +++ b/system/modules/hardware/ssd/default.nix @@ -0,0 +1,26 @@ +{ lib, config, ... }: + +let + cfg = config.systemModules.hardware.ssd; + inherit (lib) mkIf mkEnableOption; +in + +{ + options.systemModules.hardware.ssd = { + enable = mkEnableOption "Enable bluetooth module"; + }; + + config = mkIf cfg.enable { + services.fstrim = { + enable = true; + }; + # only run fstrim while connected on AC + systemd.services.fstrim = { + unitConfig.ConditionACPower = true; + serviceConfig = { + Nice = 19; + IOSchedulingClass = "idle"; + }; + }; + }; +}