From 1ac3a9b210d6fc2e1adb52071e34a346d9abe13a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 5 Oct 2021 01:26:39 +1000 Subject: [PATCH] music nix for desktops --- profiles/desktop/music.nix | 69 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 profiles/desktop/music.nix diff --git a/profiles/desktop/music.nix b/profiles/desktop/music.nix new file mode 100644 index 00000000..c358155c --- /dev/null +++ b/profiles/desktop/music.nix @@ -0,0 +1,69 @@ +{ pkgs, ...}: + +{ + environment.systemPackages = [ + tidal + vcv-rack + supercollider + orca-c + carla + helm + sunvox + ]; + + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = false; + jack.enable = true; + # Low latency pipewire + # The best way to get everything working is to keep increasing the quant value until you get no crackles (underruns) or until you get audio again (in case there wasn't any). This won't guarantee the lowest possible latency, but will provide a decent one paired with stable audio. + config.pipewire = { + "context.properties" = { + "link.max-buffers" = 16; + "log.level" = 2; + "default.clock.rate" = 48000; + "default.clock.quantum" = 32; + "default.clock.min-quantum" = 32; + "default.clock.max-quantum" = 32; + "core.daemon" = true; + "core.name" = "pipewire-0"; + }; + "context.modules" = [ + { + name = "libpipewire-module-rtkit"; + args = { + "nice.level" = -15; + "rt.prio" = 88; + "rt.time.soft" = 200000; + "rt.time.hard" = 200000; + }; + flags = [ "ifexists" "nofail" ]; + } + + { name = "libpipewire-module-protocol-native"; } + { name = "libpipewire-module-profiler"; } + { name = "libpipewire-module-metadata"; } + { name = "libpipewire-module-spa-device-factory"; } + { name = "libpipewire-module-spa-node-factory"; } + { name = "libpipewire-module-client-node"; } + { name = "libpipewire-module-client-device"; } + + { + name = "libpipewire-module-portal"; + flags = [ "ifexists" "nofail" ]; + } + { + name = "libpipewire-module-access"; + args = {}; + } + + { name = "libpipewire-module-adapter"; } + { name = "libpipewire-module-link-factory"; } + { name = "libpipewire-module-session-manager"; } + ]; + }; + }; +}