Parameterise ssd module
This commit is contained in:
parent
f718f79192
commit
ab39c6035c
|
@ -6,7 +6,6 @@
|
|||
./hardware-configuration.nix
|
||||
../../modules/cpu/intel.nix
|
||||
../../modules/gpu/intel.nix
|
||||
../../modules/ssd.nix
|
||||
../../modules/libvirt.nix
|
||||
../../modules
|
||||
../../profiles/dev.nix
|
||||
|
@ -16,6 +15,7 @@
|
|||
sbruder = {
|
||||
gui = true;
|
||||
restic.enable = true;
|
||||
ssd.enable = true;
|
||||
wireguard.home = {
|
||||
enable = true;
|
||||
address = "10.80.0.4";
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
../../modules/cpu/intel.nix
|
||||
../../modules/gpu/amd.nix
|
||||
../../modules/libvirt.nix
|
||||
../../modules/ssd.nix
|
||||
../../modules
|
||||
../../profiles/dev.nix
|
||||
../../users/simon
|
||||
|
@ -16,6 +15,7 @@
|
|||
sbruder = {
|
||||
gui = true;
|
||||
restic.enable = true;
|
||||
ssd.enable = true;
|
||||
wireguard.home = {
|
||||
enable = true;
|
||||
address = "10.80.0.5";
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
./prometheus/node_exporter.nix
|
||||
./pulseaudio.nix
|
||||
./restic.nix
|
||||
./ssd.nix
|
||||
./ssh.nix
|
||||
./sway.nix
|
||||
./tools.nix
|
||||
|
|
|
@ -1,4 +1,32 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.sbruder.ssd;
|
||||
in
|
||||
{
|
||||
fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
|
||||
services.fstrim.enable = true;
|
||||
options.sbruder.ssd = {
|
||||
enable = lib.mkEnableOption "ssd optimisations";
|
||||
fileSystems = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ "/" ];
|
||||
description = "List of file systems to apply optimisations to";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
fileSystems = builtins.listToAttrs
|
||||
(builtins.map
|
||||
(fs: {
|
||||
name = fs;
|
||||
value = {
|
||||
options = [
|
||||
"discard"
|
||||
"noatime"
|
||||
"nodiratime"
|
||||
];
|
||||
};
|
||||
})
|
||||
cfg.fileSystems);
|
||||
|
||||
services.fstrim.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue