From 5bfa655d3e9704918681b2fc187cd6c2feaec81c Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 14 Sep 2023 20:09:51 +0200 Subject: [PATCH] Add config for fstrim --- config/common/storage.nix | 10 ++++++++++ config/nixos-generators/proxmox.nix | 1 + 2 files changed, 11 insertions(+) create mode 100644 config/common/storage.nix diff --git a/config/common/storage.nix b/config/common/storage.nix new file mode 100644 index 0000000..667cdc4 --- /dev/null +++ b/config/common/storage.nix @@ -0,0 +1,10 @@ +# Common storage configuration. +# Sources for this configuration: +# - https://git.grzb.de/yuri/nix-infra/-/blob/aa38daeea59f2ca12b7e591de6f8b61565780c48/configuration/common/default.nix#L73 + +{ config, pkgs, ... }: + +{ + # Enable periodic SSD TRIM on mounted paritions in the background. + services.fstrim.enable = true; +} diff --git a/config/nixos-generators/proxmox.nix b/config/nixos-generators/proxmox.nix index 1c79fbd..ff42fb4 100644 --- a/config/nixos-generators/proxmox.nix +++ b/config/nixos-generators/proxmox.nix @@ -11,6 +11,7 @@ boot = "order=virtio0"; cores = 2; memory = 512; + virtio0 = "rpool-data:vm-9999-disk-0,discard=on"; bios = "seabios"; net0 = "virtio=00:00:00:00:00:00,bridge=vmbr0,firewall=1,tag=999"; };