My NixOS and Home Manager configurations
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix pipewire stuff

quasigod 948881a1 d9927792

+5 -106
+5 -2
modules/gaming.nix
··· 57 57 nixos = 58 58 { pkgs, ... }: 59 59 { 60 - imports = [ inputs.nix-gaming.nixosModules.platformOptimizations ]; 60 + imports = [ 61 + inputs.nix-gaming.nixosModules.platformOptimizations 62 + inputs.nix-gaming.nixosModules.pipewireLowLatency 63 + ]; 61 64 hardware.opentabletdriver.enable = true; 62 65 services = { 63 66 input-remapper.enable = true; 64 - system76-scheduler.enable = true; 67 + pipewire.lowLatency.enable = true; 65 68 }; 66 69 programs = { 67 70 steam = {
-5
modules/hosts/hades/default.nix
··· 34 34 ai._.ollama 35 35 apps._.radicle 36 36 apps._.zsa 37 - # (pipewire._.lowlatency { 38 - # quantum = 48000; 39 - # rate = 128; 40 - # }) 41 37 ]; 42 38 43 39 nixos = ··· 50 46 nixos-hardware.nixosModules.common-cpu-amd 51 47 nixos-hardware.nixosModules.common-gpu-amd 52 48 nixos-hardware.nixosModules.common-pc-ssd 53 - # nix-gaming.nixosModules.pipewireLowLatency 54 49 maccel.nixosModules.default 55 50 ]; 56 51 nixpkgs.config.rocmSupport = true;
-99
modules/pwlowlatency.nix
··· 1 - { 2 - styx.pipewire._.lowlatency = 3 - { 4 - quantum ? 44100, 5 - rate ? 32, 6 - ... 7 - }: 8 - { 9 - nixos = 10 - { pkgs, lib, ... }: 11 - let 12 - qr = "${toString quantum}/${toString rate}"; 13 - inherit (lib.generators) toLua; 14 - in 15 - { 16 - services.pipewire = { 17 - # make sure PipeWire is enabled if the module is imported 18 - # and low latency is enabledd 19 - enable = true; 20 - 21 - # write extra config 22 - extraConfig = { 23 - pipewire."99-lowlatency" = { 24 - "context.properties" = { 25 - "default.clock.min-quantum" = quantum; 26 - }; 27 - 28 - "module.rt.args" = { 29 - "nice.level" = -15; 30 - "rt.prio" = 88; 31 - "rt.time.soft" = 200000; 32 - "rt.time.hard" = 200000; 33 - }; 34 - }; 35 - 36 - pipewire-pulse."99-lowlatency" = { 37 - "pulse.properties" = { 38 - "server.address" = [ "unix:native" ]; 39 - "pulse.min.req" = qr; 40 - "pulse.min.quantum" = qr; 41 - "pulse.min.frag" = qr; 42 - }; 43 - }; 44 - 45 - client."99-lowlatency" = { 46 - "stream.properties" = { 47 - "node.latency" = qr; 48 - "resample.quality" = 1; 49 - }; 50 - }; 51 - }; 52 - 53 - # ensure WirePlumber is enabled explicitly (defaults to true while PW is enabled) 54 - # and write extra config to ship low latency rules for alsa 55 - wireplumber = { 56 - enable = true; 57 - configPackages = 58 - let 59 - # generate "matches" section of the rules 60 - matches = 61 - toLua 62 - { 63 - multiline = false; # looks better while inline 64 - indent = false; 65 - } 66 - [ 67 - [ 68 - [ 69 - "node.name" 70 - "matches" 71 - "alsa_output.*" 72 - ] 73 - ] 74 - ]; # nested lists are to produce `{{{ }}}` in the output 75 - 76 - # generate "apply_properties" section of the rules 77 - apply_properties = toLua { } { 78 - "audio.format" = "S32LE"; 79 - "audio.rate" = rate * 2; 80 - "api.alsa.period-size" = 2; 81 - }; 82 - in 83 - [ 84 - (pkgs.writeTextDir "share/lowlatency.lua.d/99-alsa-lowlatency.lua" '' 85 - -- Generated by nix-gaming 86 - alsa_monitor.rules = { 87 - { 88 - matches = ${matches}; 89 - apply_properties = ${apply_properties}; 90 - } 91 - } 92 - '') 93 - ]; 94 - }; 95 - }; 96 - }; 97 - }; 98 - } 99 -