diff --git a/configuration.nix b/configuration.nix index fdd9a99..9475b5c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -22,6 +22,18 @@ let fi ''; lib = pkgs.lib; + + # the default priorities put the internal mic above headphones one + acp-paths = pkgs.runCommand "acp-paths" { } '' + mkdir -p $out + for f in ${pkgs.pipewire.lib}/share/alsa-card-profile/mixer/paths/*; do + ln -s $f $out/ + done + cp --remove-destination "$(readlink "$out/analog-input-internal-mic.conf")" "$out/analog-input-internal-mic.conf" + cp --remove-destination "$(readlink "$out/analog-input-internal-mic-always.conf")" "$out/analog-input-internal-mic-always.conf" + sed -i 's/^priority = [0-9]*/priority = 79/' "$out/analog-input-internal-mic.conf" + sed -i 's/^priority = [0-9]*/priority = 79/' "$out/analog-input-internal-mic-always.conf" + ''; in { imports = @@ -102,6 +114,7 @@ in setSocketVariable = true; }; }; + # Declarative containers programs.extra-container.enable = true; @@ -273,6 +286,17 @@ in # Enable CUPS to print documents. services.printing.enable = true; + # Override paths for alsa-card-paths with one with my own priorities + systemd.user.services = { + pipewire-media-session.environment = { + ACP_PATHS_DIR = "${acp-paths}"; + }; + + wireplumber.environment = { + ACP_PATHS_DIR = "${acp-paths}"; + }; + }; + hardware.bluetooth.enable = true; # Enable sound with pipewire.