From b8f2c0458372c6772bdf29e23b19523c628889ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Tue, 5 Dec 2023 22:43:03 +0100 Subject: [PATCH] chocolatebar/audio: move audio settings, add RT pipewire config --- hosts/chocolatebar/audio.nix | 36 ++++++++++++++++++++++++++++ hosts/chocolatebar/configuration.nix | 5 ---- hosts/chocolatebar/default.nix | 1 + 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 hosts/chocolatebar/audio.nix diff --git a/hosts/chocolatebar/audio.nix b/hosts/chocolatebar/audio.nix new file mode 100644 index 0000000..ef65c2c --- /dev/null +++ b/hosts/chocolatebar/audio.nix @@ -0,0 +1,36 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + psCfg = config.pub-solar; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; +in { + musnix = { + enable = true; + kernel.realtime = true; + soundcardPciId = "0d:00.4"; + }; + + users.users."${psCfg.user.name}".extraGroups = ["realtime"]; + + home-manager.users."${psCfg.user.name}" = { + home.packages = with pkgs; [ + lmms + audacity + ]; + }; + + environment.etc = { + "pipewire/pipewire.conf.d/92-low-latency.conf".text = '' + context.properties = { + default.clock.rate = 48000 + default.clock.quantum = 32 + default.clock.min-quantum = 32 + default.clock.max-quantum = 32 + } + ''; + }; +} diff --git a/hosts/chocolatebar/configuration.nix b/hosts/chocolatebar/configuration.nix index 14fe9ca..1dc6bbe 100644 --- a/hosts/chocolatebar/configuration.nix +++ b/hosts/chocolatebar/configuration.nix @@ -58,11 +58,6 @@ in { ]; }; - musnix = { - enable = true; - kernel.realtime = true; - }; - # For OpenProject development with https security.pki.certificates = [ (builtins.readFile ./step-roots.pem) diff --git a/hosts/chocolatebar/default.nix b/hosts/chocolatebar/default.nix index 283e273..1152c2d 100644 --- a/hosts/chocolatebar/default.nix +++ b/hosts/chocolatebar/default.nix @@ -4,6 +4,7 @@ ./hardware-configuration.nix ./networking.nix + ./audio.nix ./virtualisation # ./factorio ];