From 5bec39e709ed7b8c402b817979410694cf06e884 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Tue, 9 Jan 2024 18:56:16 +0100 Subject: [PATCH] Enable TRIM on x86 hardware --- systems/gwyn/default.nix | 6 +++++- systems/staubfinger/default.nix | 11 +++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/systems/gwyn/default.nix b/systems/gwyn/default.nix index e741d2f..3300d2d 100644 --- a/systems/gwyn/default.nix +++ b/systems/gwyn/default.nix @@ -22,7 +22,10 @@ boot.extraModulePackages = [ ]; boot.kernelParams = [ ]; - boot.initrd.luks.devices."cryptlvm".device = "/dev/nvme0n1p2"; + boot.initrd.luks.devices."cryptlvm" = { + allowDiscards = true; + device = "/dev/nvme0n1p2"; + }; # Required to build aarch64 packages boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; @@ -63,6 +66,7 @@ az-restic-client-desktop.enable = true; az-tlp.enable = true; az-x86.enable = true; + fstrim.enable = true; # Enable TRIM for SD cards hardware.bolt.enable = true; # Enable Thunderbolt control logind.lidSwitchExternalPower = "ignore"; }; diff --git a/systems/staubfinger/default.nix b/systems/staubfinger/default.nix index b465c60..05642c3 100644 --- a/systems/staubfinger/default.nix +++ b/systems/staubfinger/default.nix @@ -11,8 +11,14 @@ boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; boot.kernelParams = [ "acpi_osi=" ]; - boot.initrd.luks.devices."cryptlvm".device = "/dev/sda2"; - boot.initrd.luks.devices."cryptswap".device = "/dev/sda3"; + boot.initrd.luks.devices."cryptlvm" = { + allowDiscards = true; + device = "/dev/sda2"; + }; + boot.initrd.luks.devices."cryptswap" = { + allowDiscards = true; + device = "/dev/sda3"; + }; boot.loader.efi.efiSysMountPoint = "/boot/efi"; @@ -45,6 +51,7 @@ az-restic-client-desktop.enable = true; az-tlp.enable = true; az-x86.enable = true; + fstrim.enable = true; # Enable TRIM for SD cards }; virtualisation.virtualbox.host.enable = true; }