diff options
author | Thomas Watson <twatson52@icloud.com> | 2024-03-11 21:02:32 -0500 |
---|---|---|
committer | Thomas Watson <twatson52@icloud.com> | 2024-03-11 21:02:32 -0500 |
commit | 09b0a8ef715d46296e1865adf95cfa9503fd6487 (patch) | |
tree | 703b37729773d2ca075360be34ade88c7b95f897 /apple-silicon-support/modules/sound | |
parent | 2aa408936e856f7ea76563cf438083162fba5476 (diff) | |
download | nixlib-09b0a8ef715d46296e1865adf95cfa9503fd6487.tar nixlib-09b0a8ef715d46296e1865adf95cfa9503fd6487.tar.gz nixlib-09b0a8ef715d46296e1865adf95cfa9503fd6487.tar.bz2 nixlib-09b0a8ef715d46296e1865adf95cfa9503fd6487.tar.lz nixlib-09b0a8ef715d46296e1865adf95cfa9503fd6487.tar.xz nixlib-09b0a8ef715d46296e1865adf95cfa9503fd6487.tar.zst nixlib-09b0a8ef715d46296e1865adf95cfa9503fd6487.zip |
modules: add hardware.asahi.enable (true by default)
Diffstat (limited to 'apple-silicon-support/modules/sound')
-rw-r--r-- | apple-silicon-support/modules/sound/default.nix | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apple-silicon-support/modules/sound/default.nix b/apple-silicon-support/modules/sound/default.nix index 38e412b9e174..d76e7138d4c9 100644 --- a/apple-silicon-support/modules/sound/default.nix +++ b/apple-silicon-support/modules/sound/default.nix @@ -5,13 +5,13 @@ # disable pulseaudio as the Asahi sound infrastructure can't use it. # if we disable it only if setupAsahiSound is enabled, then infinite # recursion results as pulseaudio enables config.sound by default. - { config.hardware.pulseaudio.enable = false; } + { config.hardware.pulseaudio.enable = (!config.hardware.asahi.enable); } ]; options.hardware.asahi = { setupAsahiSound = lib.mkOption { type = lib.types.bool; - default = config.sound.enable; + default = config.sound.enable && config.hardware.asahi.enable; description = '' Set up the Asahi DSP components so that the speakers and headphone jack work properly and safely. @@ -20,6 +20,8 @@ }; config = let + cfg = config.hardware.asahi; + asahi-audio = pkgs.asahi-audio; # the asahi-audio we use lsp-plugins = pkgs.lsp-plugins; # the lsp-plugins we use @@ -39,7 +41,7 @@ newHotness = builtins.hasAttr "configPackages" options.services.pipewire; lv2Path = lib.makeSearchPath "lib/lv2" [ lsp-plugins pkgs.bankstown-lv2 ]; - in lib.mkIf config.hardware.asahi.setupAsahiSound (lib.mkMerge [ + in lib.mkIf (cfg.setupAsahiSound && cfg.enable) (lib.mkMerge [ { # enable pipewire to run real-time and avoid audible glitches security.rtkit.enable = true; |