From d155147165b807a7b58830759695d95ee2a7017f Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Thu, 2 Oct 2025 20:10:22 +0200 Subject: [PATCH] feat(desktop): do some more settings for better performance. --- hosts/skadi/configuration.nix | 21 ++++++++++++++++++++- modules/linux/nixos/boot.nix | 16 ++++++++++++++++ modules/linux/nixos/default.nix | 2 ++ modules/linux/nixos/watchdog.nix | 1 - 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 modules/linux/nixos/boot.nix diff --git a/hosts/skadi/configuration.nix b/hosts/skadi/configuration.nix index 37540a9..8680efc 100644 --- a/hosts/skadi/configuration.nix +++ b/hosts/skadi/configuration.nix @@ -103,11 +103,29 @@ programs.noisetorch.enable = true; # Enable sound with pipewire. - services.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; pulse.enable = true; + + extraConfig.pipewire."92-low-latency" = { + "context.properties" = { + "default.clock.rate" = 48000; + "default.clock.quantum" = 256; + "default.clock.min-quantum" = 256; + "default.clock.max-quantum" = 256; + }; + }; + wireplumber.extraConfig = { + "10-disable-camera" = { + "wireplumber.profiles" = { + main = { + "monitor.libcamera" = "disabled"; + }; + }; + }; + }; + alsa = { enable = true; support32Bit = true; @@ -175,6 +193,7 @@ crony.sddm.enable = true; crony.wireguard.enable = true; crony.secrets.enable = true; + crony.boot.enable = true; # List packages installed in system profile environment.systemPackages = with pkgs; [ diff --git a/modules/linux/nixos/boot.nix b/modules/linux/nixos/boot.nix new file mode 100644 index 0000000..db9b242 --- /dev/null +++ b/modules/linux/nixos/boot.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + ... +}: { + options = { + crony.boot.enable = lib.mkEnableOption "Enable and setup kernel related parameters"; + }; + + config = lib.mkIf config.crony.boot.enable { + boot.kernel.sysctl = { + "vm.swappiness" = 10; + "kernel.nmi_watchdog" = 0; + }; + }; +} diff --git a/modules/linux/nixos/default.nix b/modules/linux/nixos/default.nix index 66e44de..bc2563c 100644 --- a/modules/linux/nixos/default.nix +++ b/modules/linux/nixos/default.nix @@ -25,6 +25,7 @@ ./ollama.nix ./secrets.nix ./oom.nix + ./boot.nix ]; crony.bluetooth.enable = lib.mkDefault true; @@ -52,4 +53,5 @@ crony.ollama.enable = lib.mkDefault false; crony.secrets.enable = lib.mkDefault false; crony.oom.enable = lib.mkDefault true; + crony.boot.enable = lib.mkDefault false; } diff --git a/modules/linux/nixos/watchdog.nix b/modules/linux/nixos/watchdog.nix index 9e74fa7..5bfc288 100644 --- a/modules/linux/nixos/watchdog.nix +++ b/modules/linux/nixos/watchdog.nix @@ -8,7 +8,6 @@ }; config = lib.mkIf config.crony.watchdog.disable { - boot.kernelParams = ["nmi_watchdog=0"]; boot.blacklistedKernelModules = ["sp5100_tco"]; }; }