diff --git a/modules/nixos/shared/core.nix b/modules/nixos/shared/core.nix index 4b3d90d..0f31e86 100644 --- a/modules/nixos/shared/core.nix +++ b/modules/nixos/shared/core.nix @@ -39,8 +39,48 @@ in alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; - jack.enable = true; + jack.enable = false; + extraConfig.pipewire."92-low-latency" = { + "context.properties" = { + "default.clock.rate" = 44100; + "default.clock.quantum" = 512; + "default.clock.min-quantum" = 512; + "default.clock.max-quantum" = 512; + }; + }; }; + + services.udev.extraRules = '' + KERNEL=="rtc0", GROUP="audio" + KERNEL=="hpet", GROUP="audio" + ''; + + security.pam.loginLimits = [ + { + domain = "@audio"; + item = "memlock"; + type = "-"; + value = "unlimited"; + } + { + domain = "@audio"; + item = "rtprio"; + type = "-"; + value = "99"; + } + { + domain = "@audio"; + item = "nofile"; + type = "soft"; + value = "99999"; + } + { + domain = "@audio"; + item = "nofile"; + type = "hard"; + value = "524288"; + } + ]; }) (mkIf cfg.bluetooth.enable { hardware.bluetooth.enable = true;