Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/pulseaudio: Add extraModules config option #48639

Merged
merged 2 commits into from Oct 18, 2018

Conversation

adisbladis
Copy link
Member

@adisbladis adisbladis commented Oct 17, 2018

Motivation for this change

Previously the method to use pulseaudio-modules-bt was very hacky.
With this PR the mechanism to use out-of-tree PA modules becomes:

  hardware.pulseaudio = {
    enable = true;
    extraModules = [ pkgs.pulseaudio-modules-bt ];
    package = pkgs.pulseaudioFull;
  };

The caveats are that any derivations in extraModules is expected to follow the same directory structure as pulseaudio does internally, that is:

"lib/pulse-${pulseaudio.version}/modules/module.so"

and the derivation is expected to take an argument pulseaudio that is the package specified in hardware.pulseaudio.package.
Any extraModules are built with the specified package as an override.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

cc @teto @lovek323

edit: Additional documentation for any archeologists.

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: pulseaudio-modules-bt

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: pulseaudio-modules-bt

Partial log (click to expand)

shrinking /nix/store/9cfpcmx067hs89bp67vzmjmczik1hp8y-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/module-bluez5-device.so
shrinking /nix/store/9cfpcmx067hs89bp67vzmjmczik1hp8y-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/module-bluez5-discover.so
shrinking /nix/store/9cfpcmx067hs89bp67vzmjmczik1hp8y-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/libbluez5-util.so
shrinking /nix/store/9cfpcmx067hs89bp67vzmjmczik1hp8y-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/libldacBT_abr.so
shrinking /nix/store/9cfpcmx067hs89bp67vzmjmczik1hp8y-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/libldacBT_enc.so
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/9cfpcmx067hs89bp67vzmjmczik1hp8y-pulseaudio-modules-bt-unstable-2018-10-16/lib
patching script interpreter paths in /nix/store/9cfpcmx067hs89bp67vzmjmczik1hp8y-pulseaudio-modules-bt-unstable-2018-10-16
checking for references to /build in /nix/store/9cfpcmx067hs89bp67vzmjmczik1hp8y-pulseaudio-modules-bt-unstable-2018-10-16...
/nix/store/9cfpcmx067hs89bp67vzmjmczik1hp8y-pulseaudio-modules-bt-unstable-2018-10-16

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: pulseaudio-modules-bt

Partial log (click to expand)

shrinking /nix/store/mds0745zkcsppnnbbxgzhdwmimlavbvh-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/module-bluetooth-policy.so
shrinking /nix/store/mds0745zkcsppnnbbxgzhdwmimlavbvh-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/libldacBT_abr.so
shrinking /nix/store/mds0745zkcsppnnbbxgzhdwmimlavbvh-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/module-bluetooth-discover.so
shrinking /nix/store/mds0745zkcsppnnbbxgzhdwmimlavbvh-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/module-bluez5-device.so
shrinking /nix/store/mds0745zkcsppnnbbxgzhdwmimlavbvh-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/libbluez5-util.so
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/mds0745zkcsppnnbbxgzhdwmimlavbvh-pulseaudio-modules-bt-unstable-2018-10-16/lib
patching script interpreter paths in /nix/store/mds0745zkcsppnnbbxgzhdwmimlavbvh-pulseaudio-modules-bt-unstable-2018-10-16
checking for references to /build in /nix/store/mds0745zkcsppnnbbxgzhdwmimlavbvh-pulseaudio-modules-bt-unstable-2018-10-16...
/nix/store/mds0745zkcsppnnbbxgzhdwmimlavbvh-pulseaudio-modules-bt-unstable-2018-10-16

@adisbladis adisbladis changed the title nixos/pulseaudio: Add extraModules config option WIP: nixos/pulseaudio: Add extraModules config option Oct 18, 2018
@adisbladis adisbladis changed the title WIP: nixos/pulseaudio: Add extraModules config option nixos/pulseaudio: Add extraModules config option Oct 18, 2018
@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: pulseaudio-modules-bt

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: pulseaudio-modules-bt

Partial log (click to expand)

shrinking /nix/store/7qmn9dxvl6c7jjfjgvqs9jhi8flfiz1l-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/module-bluez5-device.so
shrinking /nix/store/7qmn9dxvl6c7jjfjgvqs9jhi8flfiz1l-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/module-bluez5-discover.so
shrinking /nix/store/7qmn9dxvl6c7jjfjgvqs9jhi8flfiz1l-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/libbluez5-util.so
shrinking /nix/store/7qmn9dxvl6c7jjfjgvqs9jhi8flfiz1l-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/libldacBT_abr.so
shrinking /nix/store/7qmn9dxvl6c7jjfjgvqs9jhi8flfiz1l-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/libldacBT_enc.so
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/7qmn9dxvl6c7jjfjgvqs9jhi8flfiz1l-pulseaudio-modules-bt-unstable-2018-10-16/lib
patching script interpreter paths in /nix/store/7qmn9dxvl6c7jjfjgvqs9jhi8flfiz1l-pulseaudio-modules-bt-unstable-2018-10-16
checking for references to /build in /nix/store/7qmn9dxvl6c7jjfjgvqs9jhi8flfiz1l-pulseaudio-modules-bt-unstable-2018-10-16...
/nix/store/7qmn9dxvl6c7jjfjgvqs9jhi8flfiz1l-pulseaudio-modules-bt-unstable-2018-10-16

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: pulseaudio-modules-bt

Partial log (click to expand)

shrinking /nix/store/fgbdmxv6s8da2niqkd0wlw0v9xavbay6-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/module-bluetooth-policy.so
shrinking /nix/store/fgbdmxv6s8da2niqkd0wlw0v9xavbay6-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/libldacBT_abr.so
shrinking /nix/store/fgbdmxv6s8da2niqkd0wlw0v9xavbay6-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/module-bluetooth-discover.so
shrinking /nix/store/fgbdmxv6s8da2niqkd0wlw0v9xavbay6-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/module-bluez5-device.so
shrinking /nix/store/fgbdmxv6s8da2niqkd0wlw0v9xavbay6-pulseaudio-modules-bt-unstable-2018-10-16/lib/pulse-12.2/modules/libbluez5-util.so
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/fgbdmxv6s8da2niqkd0wlw0v9xavbay6-pulseaudio-modules-bt-unstable-2018-10-16/lib
patching script interpreter paths in /nix/store/fgbdmxv6s8da2niqkd0wlw0v9xavbay6-pulseaudio-modules-bt-unstable-2018-10-16
checking for references to /build in /nix/store/fgbdmxv6s8da2niqkd0wlw0v9xavbay6-pulseaudio-modules-bt-unstable-2018-10-16...
/nix/store/fgbdmxv6s8da2niqkd0wlw0v9xavbay6-pulseaudio-modules-bt-unstable-2018-10-16

@teto
Copy link
Member

teto commented Oct 18, 2018

I can't cherry-pick on nixos-unstable so I haven't tested it but I am all for it, the current mechanism to include the extra bluetooh module does not feel clean.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: pulseaudio-modules-bt

Partial log (click to expand)

/nix/store/fgbdmxv6s8da2niqkd0wlw0v9xavbay6-pulseaudio-modules-bt-unstable-2018-10-16

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: pulseaudio-modules-bt

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: pulseaudio-modules-bt

Partial log (click to expand)

/nix/store/7qmn9dxvl6c7jjfjgvqs9jhi8flfiz1l-pulseaudio-modules-bt-unstable-2018-10-16

@adisbladis adisbladis merged commit 3026f55 into NixOS:master Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants