about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--apple-silicon-support/modules/sound/default.nix30
-rw-r--r--apple-silicon-support/packages/asahi-audio/default.nix14
2 files changed, 13 insertions, 31 deletions
diff --git a/apple-silicon-support/modules/sound/default.nix b/apple-silicon-support/modules/sound/default.nix
index e1b45a8dcbcf..98b111237d61 100644
--- a/apple-silicon-support/modules/sound/default.nix
+++ b/apple-silicon-support/modules/sound/default.nix
@@ -36,34 +36,30 @@
     # enable pipewire to run real-time and avoid audible glitches
     security.rtkit.enable = true;
     # set up pipewire with the supported capabilities (instead of pulseaudio)
+    # and asahi-audio configs and plugins
     services.pipewire = {
       enable = true;
+      configPackages = [ asahi-audio ];
+      extraLv2Packages = [ lsp-plugins pkgs.bankstown-lv2 ];
 
       alsa.enable = true;
-      wireplumber.enable = true;
       pulse.enable = true;
+      wireplumber = {
+        enable = true;
+        configPackages = [ asahi-audio ];
+        extraLv2Packages = [ lsp-plugins pkgs.bankstown-lv2 ];
+      };
     };
 
+    # set up enivronment so that UCM configs are used as well
+    environment.variables.ALSA_CONFIG_UCM2 = "${pkgs.alsa-ucm-conf-asahi}/share/alsa/ucm2";
+    systemd.user.services.pipewire.environment.ALSA_CONFIG_UCM2 = config.environment.variables.ALSA_CONFIG_UCM2;
+    systemd.user.services.wireplumber.environment.ALSA_CONFIG_UCM2 = config.environment.variables.ALSA_CONFIG_UCM2;
+
     # enable speakersafetyd to protect speakers
     systemd.packages = lib.mkAssert lsp-plugins-is-safe
       "lsp-plugins is unpatched/outdated and speakers cannot be safely enabled"
       [ pkgs.speakersafetyd ];
     services.udev.packages = [ pkgs.speakersafetyd ];
-
-    # set up enivronment so that asahi-audio and UCM configs are used
-    environment.etc = builtins.listToAttrs (builtins.map
-      (f: { name = f; value = { source = "${asahi-audio}/share/${f}"; }; })
-      asahi-audio.providedConfigFiles);
-    environment.variables.ALSA_CONFIG_UCM2 = "${pkgs.alsa-ucm-conf-asahi}/share/alsa/ucm2";
-
-    # set up pipewire and wireplumber to use asahi-audio configs and plugins
-    systemd.user.services.pipewire.environment.ALSA_CONFIG_UCM2 = config.environment.variables.ALSA_CONFIG_UCM2;
-    systemd.user.services.wireplumber.environment.ALSA_CONFIG_UCM2 = config.environment.variables.ALSA_CONFIG_UCM2;
-    systemd.user.services.pipewire.environment.LV2_PATH = let
-      lv2Plugins = [ lsp-plugins pkgs.bankstown-lv2 ];
-    in lib.makeSearchPath "lib/lv2" lv2Plugins;
-    systemd.user.services.wireplumber.environment.LV2_PATH = let
-      lv2Plugins = [ lsp-plugins pkgs.bankstown-lv2 ];
-    in lib.makeSearchPath "lib/lv2" lv2Plugins;
   };
 }
diff --git a/apple-silicon-support/packages/asahi-audio/default.nix b/apple-silicon-support/packages/asahi-audio/default.nix
index 4ccbcc5d066c..d54c26cb299f 100644
--- a/apple-silicon-support/packages/asahi-audio/default.nix
+++ b/apple-silicon-support/packages/asahi-audio/default.nix
@@ -6,7 +6,6 @@
 stdenv.mkDerivation rec {
   pname = "asahi-audio";
   # tracking: https://src.fedoraproject.org/rpms/asahi-audio
-  # note: ensure that the providedConfigFiles list below is current!
   version = "1.6";
 
   src = fetchFromGitHub {
@@ -35,17 +34,4 @@ stdenv.mkDerivation rec {
     # no need to link the asahi-audio dir globally
     mv $out/share/asahi-audio $out
   '';
-
-  # list of config files installed in $out/share/ and destined for
-  # /etc/, from the `install -pm0644 conf/` lines in the Makefile. note
-  # that the contents of asahi-audio/ stay in $out/ and the config files
-  # are modified to point to them.
-  passthru.providedConfigFiles = [
-    "wireplumber/wireplumber.conf.d/99-asahi.conf"
-    "wireplumber/policy.lua.d/85-asahi-policy.lua"
-    "wireplumber/main.lua.d/85-asahi.lua"
-    "wireplumber/scripts/policy-asahi.lua"
-    "pipewire/pipewire.conf.d/99-asahi.conf"
-    "pipewire/pipewire-pulse.conf.d/99-asahi.conf"
-  ];
 }