Skip to content

Instantly share code, notes, and snippets.

@Roger
Created September 7, 2023 08:42
Show Gist options
  • Select an option

  • Save Roger/0b711a605c949ca9d68def51fdab739f to your computer and use it in GitHub Desktop.

Select an option

Save Roger/0b711a605c949ca9d68def51fdab739f to your computer and use it in GitHub Desktop.

Revisions

  1. Roger created this gist Sep 7, 2023.
    48 changes: 48 additions & 0 deletions config.nix.diff
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,48 @@
    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.