feat(hardware): add ssd module to hardware
This commit is contained in:
parent
72011ba30a
commit
ea48575dd0
1 changed files with 26 additions and 0 deletions
26
system/modules/hardware/ssd/default.nix
Normal file
26
system/modules/hardware/ssd/default.nix
Normal file
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue