btrfs fixes

This commit is contained in:
2026-02-12 14:11:54 +01:00
parent e4f685b199
commit 8f60bb546a

View File

@@ -36,7 +36,7 @@
"atkbd.softrepeat=1" # Software key repeat
"amd_pstate=active" # Use AMD P-State driver for better power management
"amd_pstate.shared_mem=1"
"pcie_aspm.policy=powersupersave" # Aggressive PCIe power management
# "pcie_aspm.policy=powersupersave" # Aggressive PCIe power management
"amdgpu.gpu_recovery=1" # Enable automatic GPU recovery
"amdgpu.runpm=0" # Disable runtime PM (major hang cause)
###"amdgpu.dcdebugmask=0x400"
@@ -48,22 +48,23 @@
systemd.tpm2.enable = false;
boot.initrd.systemd.tpm2.enable = false;
#swapDevices = [{ file = "/swap/swapfile"; }];
# Enable swap file
swapDevices = [{ device = "/swap/swapfile"; }];
# Override btrfs mount options from hardware-configuration.nix
fileSystems."/" = {
options = [ "subvol=@" "compress=zstd" "space_cache=v2" "noatime"
"autodefrag" "ssd" "discard=async" ];
"lazytime" "ssd" "discard=async" ];
};
fileSystems."/home" = {
options = [ "subvol=@home" "compress=zstd" "space_cache=v2" "noatime"
"autodefrag" "ssd" "discard=async" ];
"lazytime" "ssd" "discard=async" ];
};
fileSystems."/var/log" = {
options = [ "subvol=@log" "compress=zstd" "space_cache=v2" "noatime"
"autodefrag" "ssd" "discard=async" ];
"lazytime" "ssd" "discard=async" ];
};
fileSystems."/swap" = {
@@ -83,8 +84,13 @@
# Trust the Tailscale interface
networking.firewall.trustedInterfaces = [ "tailscale0" ];
# Disable reverse path filtering for Tailscale
boot.kernel.sysctl."net.ipv4.conf.tailscale0.rp_filter" = 0;
# Disable reverse path filtering for Tailscale, change kernel writeback options
boot.kernel.sysctl = {
"net.ipv4.conf.tailscale0.rp_filter" = 0;
"vm.dirty_ratio" = 10;
"vm.dirty_background_ratio" = 5;
"vm.swappiness" = 10;
};
# Enable resolved
services.resolved.enable = true;
@@ -282,7 +288,6 @@
# Enable Docker
virtualisation.docker.enable = true;
virtualisation.docker.storageDriver = "btrfs";
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];