oom-hardware/deskpi/trim.nix
2024-10-19 00:12:51 +02:00

18 lines
427 B
Nix

{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption types;
cfg = config.hardware.deskpi.trim;
in {
options.hardware.deskpi.trim = {
enable = mkEnableOption "enable uas fstrim support";
};
config = mkIf cfg.enable {
services.udev.extraRules = ''
ACTION=="add|change", ATTRS{idVendor}=="174c", ATTRS{idProduct}=="55aa", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"
'';
};
}