41 lines
1.2 KiB
Nix
41 lines
1.2 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
#### 1. Pool-Eigenschaften (permanent) ##############################
|
|
# wird von systemd-Units bei jedem Boot angewendet
|
|
services.zfs = {
|
|
trim.enable = true; # weekly zpool trim
|
|
autoScrub = {
|
|
enable = true; # weekly scrub
|
|
interval = "Sun 04:00"; # optional ändern
|
|
pools = [ "rpool" "tank" ];
|
|
};
|
|
autoSnapshot = {
|
|
enable = true;
|
|
frequent = 4; # alle 15 min, 4 Aufbewahrung
|
|
hourly = 24;
|
|
daily = 7;
|
|
weekly = 4;
|
|
monthly = 3;
|
|
};
|
|
};
|
|
|
|
#### 2. ARC-Größe begrenzen (z. B. 8 GiB) ###########################
|
|
# 8 * 1024^3 = 8589934592
|
|
boot.kernelParams = [ "zfs.zfs_arc_max=8589934592" ]; # ≈ 16 % von 48 GB RAM :contentReference[oaicite:0]{index=0}
|
|
|
|
#### 3. Zusätzliche Module / Tools ##################################
|
|
environment.systemPackages = with pkgs; [
|
|
zfs # zpool, zfs
|
|
zfs-prune-snapshots
|
|
arc_summary
|
|
];
|
|
|
|
#### 4. Optional: Sanoid statt OpenSolaris-Snapshots ################
|
|
# services.sanoid.enable = true;
|
|
# services.sanoid.datasets."tank/media" = {
|
|
# hourly = 24; daily = 7; monthly = 3;
|
|
# };
|
|
}
|
|
|