From 0a7c1994307bb5038f51cb75f32ef54e6076f699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Fri, 26 Jan 2024 00:38:07 +0100 Subject: [PATCH] WIP: pipewire: Do something about audio crackling? --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 5 +++++ nixos-config/default.nix | 10 ++++++++-- nixos-config/yui/games.nix | 5 ++++- 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 8197c698..80cb36cf 100644 --- a/flake.lock +++ b/flake.lock @@ -207,6 +207,26 @@ "type": "github" } }, + "musnix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1702456985, + "narHash": "sha256-mnjCk8mINY4t5uIwP2eR19FOQXHTCO68+KsgKFTv1NI=", + "owner": "musnix", + "repo": "musnix", + "rev": "cf93a72da8ad677864045e9a5dd32170378d9a62", + "type": "github" + }, + "original": { + "owner": "musnix", + "repo": "musnix", + "type": "github" + } + }, "naersk": { "inputs": { "nixpkgs": [ @@ -465,6 +485,7 @@ "fenix": "fenix", "home-manager": "home-manager", "impermanence": "impermanence", + "musnix": "musnix", "nix-gaming": "nix-gaming", "nixos-anywhere": "nixos-anywhere", "nixos-hardware": "nixos-hardware", diff --git a/flake.nix b/flake.nix index 0aa927c5..6c874e3d 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,11 @@ }; }; + musnix = { + url = "github:musnix/musnix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # home-manager related inputs home-manager = { url = "github:nix-community/home-manager/release-23.11"; diff --git a/nixos-config/default.nix b/nixos-config/default.nix index 583e23a3..870c4406 100644 --- a/nixos-config/default.nix +++ b/nixos-config/default.nix @@ -7,6 +7,7 @@ imports = [ flake-inputs.home-manager.nixosModules.home-manager flake-inputs.sops-nix.nixosModules.sops + flake-inputs.musnix.nixosModules.musnix ./greeter ./sway.nix @@ -15,6 +16,11 @@ ../modules ]; + musnix = { + enable = true; + soundcardPciId = "09:00.4"; + }; + nix = { package = pkgs.nixFlakes; @@ -71,7 +77,7 @@ boot = { tmp.cleanOnBoot = true; plymouth.enable = true; - kernelPackages = pkgs.linuxKernel.packages.linux_xanmod_latest; + kernelPackages = pkgs.linuxKernel.packages.linux_xanmod; loader = { timeout = 0; @@ -109,7 +115,7 @@ users = { tlater = { isNormalUser = true; - extraGroups = ["wheel" "video" "network"]; + extraGroups = ["wheel" "video" "network" "audio"]; }; }; }; diff --git a/nixos-config/yui/games.nix b/nixos-config/yui/games.nix index 04742144..cfca1de0 100644 --- a/nixos-config/yui/games.nix +++ b/nixos-config/yui/games.nix @@ -11,7 +11,10 @@ environment.systemPackages = [pkgs.mangohud]; # Appears to resolve issues with crackling audio under high load - services.pipewire.lowLatency.enable = true; + services.pipewire.lowLatency = { + enable = true; + quantum = 128; + }; # Make steam controller work hardware.steam-hardware.enable = true;