Compare commits
2 Commits
36c3c1eae6
...
5921272649
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5921272649 | ||
![]() |
a55b594483 |
@ -55,6 +55,13 @@
|
|||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
services.zfs.autoScrub.enable = true; # Snapshots & Details kommen später
|
services.zfs.autoScrub.enable = true; # Snapshots & Details kommen später
|
||||||
|
|
||||||
|
systemd.services.zfs-prune-snapshots = {
|
||||||
|
description = "Remove ZFS snapshots older than policy";
|
||||||
|
serviceConfig.ExecStart = "/run/current-system/sw/bin/zfs-prune-snapshots -r --keep=2w";
|
||||||
|
startAt = "daily";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
# Wir pinnen den Kernel, bis ZFS 2.3.x für 6.13 bereit ist
|
# Wir pinnen den Kernel, bis ZFS 2.3.x für 6.13 bereit ist
|
||||||
boot.kernelPackages = pkgs.linuxPackages_6_12;
|
boot.kernelPackages = pkgs.linuxPackages_6_12;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
./disko.nix # disko partitionierung
|
./disko.nix # disko partitionierung
|
||||||
./hardware/hardware-configuration.nix # generiertes hardware-configuration.nix
|
./hardware/hardware-configuration.nix # generiertes hardware-configuration.nix
|
||||||
./configuration.nix # deine eigentliche Config
|
./configuration.nix # deine eigentliche Config
|
||||||
|
./modules/zfs.nix
|
||||||
disko.nixosModules.disko
|
disko.nixosModules.disko
|
||||||
nixos-hardware.nixosModules.common-pc-ssd
|
nixos-hardware.nixosModules.common-pc-ssd
|
||||||
];
|
];
|
||||||
|
39
modules/zfs.nix
Normal file
39
modules/zfs.nix
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{ 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, arc_summary
|
||||||
|
zfs-prune-snapshots
|
||||||
|
];
|
||||||
|
|
||||||
|
#### 4. Optional: Sanoid statt OpenSolaris-Snapshots ################
|
||||||
|
# services.sanoid.enable = true;
|
||||||
|
# services.sanoid.datasets."tank/media" = {
|
||||||
|
# hourly = 24; daily = 7; monthly = 3;
|
||||||
|
# };
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user