wireplumber: ensure ALSA_UCM_CONF2 env var is on PATH
this is critical for pipewire/wireplumber to work on moby
This commit is contained in:
@@ -126,40 +126,19 @@
|
|||||||
# inject specialized alsa configs via the environment.
|
# inject specialized alsa configs via the environment.
|
||||||
# specifically, this gets the pinephone headphones & internal earpiece working.
|
# specifically, this gets the pinephone headphones & internal earpiece working.
|
||||||
# see pkgs/patched/alsa-ucm-conf for more info.
|
# see pkgs/patched/alsa-ucm-conf for more info.
|
||||||
environment.variables.ALSA_CONFIG_UCM2 = "/run/current-system/sw/share/alsa/ucm2";
|
# TODO: move this directly into `sane.programs.alsa-ucm-conf`?
|
||||||
environment.pathsToLink = [ "/share/alsa/ucm2" ];
|
sane.programs.alsa-ucm-conf.packageUnwrapped = pkgs.alsa-ucm-conf-sane.override {
|
||||||
environment.systemPackages = [
|
|
||||||
(pkgs.alsa-ucm-conf-sane.override {
|
|
||||||
# internal speaker has a tendency to break :(
|
# internal speaker has a tendency to break :(
|
||||||
preferEarpiece = true;
|
preferEarpiece = true;
|
||||||
})
|
};
|
||||||
];
|
|
||||||
systemd = let
|
|
||||||
ucm-env = config.environment.variables.ALSA_CONFIG_UCM2;
|
|
||||||
in {
|
|
||||||
# cribbed from <repo:nixos/mobile-nixos:modules/quirks/audio.nix>
|
|
||||||
|
|
||||||
# pipewire
|
|
||||||
user.services.pipewire.environment.ALSA_CONFIG_UCM2 = ucm-env;
|
|
||||||
user.services.pipewire-pulse.environment.ALSA_CONFIG_UCM2 = ucm-env;
|
|
||||||
user.services.wireplumber.environment.ALSA_CONFIG_UCM2 = ucm-env;
|
|
||||||
services.pipewire.environment.ALSA_CONFIG_UCM2 = ucm-env;
|
|
||||||
services.pipewire-pulse.environment.ALSA_CONFIG_UCM2 = ucm-env;
|
|
||||||
services.wireplumber.environment.ALSA_CONFIG_UCM2 = ucm-env;
|
|
||||||
|
|
||||||
# pulseaudio
|
|
||||||
# user.services.pulseaudio.environment.ALSA_CONFIG_UCM2 = ucm-env;
|
|
||||||
# services.pulseaudio.environment.ALSA_CONFIG_UCM2 = ucm-env;
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: move elsewhere...
|
# TODO: move elsewhere...
|
||||||
services.ModemManager.serviceConfig = {
|
systemd.services.ModemManager.serviceConfig = {
|
||||||
# N.B.: the extra "" in ExecStart serves to force upstream ExecStart to be ignored
|
# N.B.: the extra "" in ExecStart serves to force upstream ExecStart to be ignored
|
||||||
ExecStart = [ "" "${pkgs.modemmanager}/bin/ModemManager --debug" ];
|
ExecStart = [ "" "${pkgs.modemmanager}/bin/ModemManager --debug" ];
|
||||||
# --debug sets DEBUG level logging: so reset
|
# --debug sets DEBUG level logging: so reset
|
||||||
ExecStartPost = [ "${pkgs.modemmanager}/bin/mmcli --set-logging=INFO" ];
|
ExecStartPost = [ "${pkgs.modemmanager}/bin/mmcli --set-logging=INFO" ];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
services.udev.extraRules = let
|
services.udev.extraRules = let
|
||||||
chmod = "${pkgs.coreutils}/bin/chmod";
|
chmod = "${pkgs.coreutils}/bin/chmod";
|
||||||
|
22
hosts/common/programs/alsa-ucm-conf.nix
Normal file
22
hosts/common/programs/alsa-ucm-conf.nix
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.sane.programs.alsa-ucm-conf;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sane.programs.alsa-ucm-conf = {
|
||||||
|
sandbox.enable = false; #< only provides #out/share/alsa
|
||||||
|
|
||||||
|
# alsa-lib package only looks in its $out/share/alsa to find runtime config data, by default.
|
||||||
|
# but ALSA_CONFIG_UCM2 is an env var that can override that.
|
||||||
|
# this is particularly needed by wireplumber;
|
||||||
|
# also *maybe* pipewire and pipewire-pulse.
|
||||||
|
# taken from <repo:nixos/mobile-nixos:modules/quirks/audio.nix>
|
||||||
|
env.ALSA_CONFIG_UCM2 = "/run/current-system/sw/share/alsa/ucm2";
|
||||||
|
|
||||||
|
enableFor.system = lib.mkIf (builtins.any (en: en) (builtins.attrValues cfg.enableFor.user)) true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.pathsToLink = lib.mkIf cfg.enabled [
|
||||||
|
"/share/alsa/ucm2"
|
||||||
|
];
|
||||||
|
}
|
@@ -5,6 +5,7 @@
|
|||||||
./abaddon.nix
|
./abaddon.nix
|
||||||
./aerc.nix
|
./aerc.nix
|
||||||
./alacritty.nix
|
./alacritty.nix
|
||||||
|
./alsa-ucm-conf.nix
|
||||||
./animatch.nix
|
./animatch.nix
|
||||||
./assorted.nix
|
./assorted.nix
|
||||||
./audacity.nix
|
./audacity.nix
|
||||||
|
@@ -25,6 +25,8 @@ in
|
|||||||
"/sys/devices"
|
"/sys/devices"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
suggestedPrograms = [ "alsa-ucm-conf" ];
|
||||||
|
|
||||||
persist.byStore.plaintext = [
|
persist.byStore.plaintext = [
|
||||||
# persist per-device volume levels
|
# persist per-device volume levels
|
||||||
".local/state/wireplumber"
|
".local/state/wireplumber"
|
||||||
|
Reference in New Issue
Block a user