From 59bd3590a4bc9be70091ac5c31cdf3669c8a670f Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sun, 5 Mar 2023 23:07:03 -0500 Subject: [PATCH] turn on fstrim for ssds --- modules/nixos/hardware/default.nix | 1 + modules/nixos/hardware/disk.nix | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 modules/nixos/hardware/disk.nix diff --git a/modules/nixos/hardware/default.nix b/modules/nixos/hardware/default.nix index 6d3f9f0..1353ec9 100644 --- a/modules/nixos/hardware/default.nix +++ b/modules/nixos/hardware/default.nix @@ -3,6 +3,7 @@ imports = [ ./audio.nix ./boot.nix + ./disk.nix ./keyboard.nix ./monitors.nix ./mouse.nix diff --git a/modules/nixos/hardware/disk.nix b/modules/nixos/hardware/disk.nix new file mode 100644 index 0000000..079823d --- /dev/null +++ b/modules/nixos/hardware/disk.nix @@ -0,0 +1,7 @@ +{ config, pkgs, lib, ... }: { + + # Enable fstrim, which tracks free space on SSDs for garbage collection + # More info: https://www.reddit.com/r/NixOS/comments/rbzhb1/if_you_have_a_ssd_dont_forget_to_enable_fstrim/ + services.fstrim.enable = true; + +}