feat: nb performance tweaks

This commit is contained in:
2025-10-15 11:25:46 +02:00
parent a05c33ad87
commit df6465fa8a
4 changed files with 42 additions and 26 deletions

View File

@@ -77,9 +77,17 @@ in {
swapDevices = [ {
device = "/nix/persist/swapfile";
size = 32 * 1024; # Size is in megabytes
size = 32 * 1024; # Size is in megabytes (for hibernation)
} ];
# Memory tuning for 92GB RAM
boot.kernel.sysctl = {
"vm.swappiness" = 10;
"vm.dirty_ratio" = 10;
"vm.dirty_background_ratio" = 5;
"vm.vfs_cache_pressure" = 50;
};
# nixos cross building qemu
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
boot.supportedFilesystems = [ "ntfs" ];
@@ -100,18 +108,6 @@ in {
General = { ControllerMode = "bredr"; };
};
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
START_CHARGE_THRESH_BAT0 = 60;
STOP_CHARGE_THRESH_BAT0 = 80;
};
};
environment.persistence."/nix/persist" = {
hideMounts = true;
directories = [
@@ -263,13 +259,16 @@ in {
};
nix = {
settings.auto-optimise-store = true;
settings.experimental-features = [ "nix-command" "flakes" ];
# autoOptimiseStore = true;
settings = {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
max-jobs = 12;
cores = 2;
};
gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 30d";
dates = "weekly";
options = "--delete-older-than 14d";
};
# Free up to 1GiB whenever there is less than 100MiB left.
extraOptions = ''