-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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/pipewire: add configPackages options #282377
nixos/pipewire: add configPackages options #282377
Conversation
Should I document the attribute in |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/asahi-audio-on-nixos-lv2-path-management/38569/4 |
1aeaa88
to
9c00064
Compare
Forgot some mentions of the not yet upstreamed asahi-audio package in the option descriptions/examples. Those have been removed with the force-push |
@tpwrules If I'm right, you set up asahi-audio for https://github.com/tpwrules/nixos-apple-silicon. I'd be happy to hear if this looks useful to you :) |
@K900 we had discussed something along these lines on Matrix, what do you think? I don't have any opinion yet. |
9c00064
to
3675056
Compare
I moved some definitions around in the pipewire module to make the git diff a bit more readable. Adding a Edit: Accidentally duplicated some systemd service settings while rebasing. Fixed that again just now |
3675056
to
09d611f
Compare
Do we really need separate options for LV2 plugins on Wireplumber and Pipewire? I'm not even sure if both need to be aware of it. |
09d611f
to
d461252
Compare
You're totally right. I think I just got a bit confused about what requires what to work when I wrote this. I was getting some errors in wireplumber about not being able to find the lv2 plugins, or something along those lines, but all docs (that I found) described this as a feature of pipewire, not wireplumber. And I kinda remember getting some errors from pipewire too, but that might've been due to other issue earlier when I was writing these changes, when I was having some other issues as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks pretty good
d461252
to
f7d5fe6
Compare
In docs PipeWire and WirePlumber should be capitalized as in this sentence.
f7d5fe6
to
e722c56
Compare
OK let's send it. |
Follow-up NixOS#282377. Some packages may want to load LV2 plugins directly from PipeWire config instead, so add another option to accomodate those.
Follow-up to NixOS#282377. NixOS#282377 broke `environment.etc."wireplumber<...>"`, however WirePlumber did not yet have `extraConfig` style options for configuring it ergonomically outside of `environment.etc`. This has caused issues for people who had custom config files for WirePlumber, as having to create a config package just to edit some settings is not as ergonomic or discoverable as with a proper `extraConfig` style option. This commit fixes this issue by adding the `extraConfig` option for additional config file and the `extraScripts` option for additional scripts to be used by config files. With WirePlumber 0.5 it is possible to supply config files and scripts via the `XDG_DATA_DIRS` variable to the WirePlumber daemon. This is how the new options and with this change also the `configPackages` option expose their files to the daemon. This way `environment.etc."wireplumber"` works again for user configuration and breakage of old configs from 23.11 to 24.05 should be limited to those caused by the change in the config format from WirePlumber 0.4 to 0.5.
Follow-up to NixOS#282377. NixOS#282377 broke `environment.etc."wireplumber<...>"`, however WirePlumber did not yet have `extraConfig` style options for configuring it ergonomically outside of `environment.etc`. This has caused issues for people who had custom config files for WirePlumber, as having to create a config package just to edit some settings is not as ergonomic or discoverable as with a proper `extraConfig` style option. This commit fixes this issue by adding the `extraConfig` option for additional config file and the `extraScripts` option for additional scripts to be used by config files. With WirePlumber 0.5 it is possible to supply config files and scripts via the `XDG_DATA_DIRS` variable to the WirePlumber daemon. This is how the new options and with this change also the `configPackages` option expose their files to the daemon. This way `environment.etc."wireplumber"` works again for user configuration and breakage of old configs from 23.11 to 24.05 should be limited to those caused by the change in the config format from WirePlumber 0.4 to 0.5.
Description of changes
Added
configPackages
options to bothservices.pipewire
andservices.pipewire.wireplumber
. Packages specified in these options have their relevant files (e.g.share/pipewire/pipewire.conf.d/*
) combined in store path generated bypkgs.buildEnv
and linked to/etc/
.Pipewire
extraConfig
options also get added to this store path in the appropriate locations.Added
extraLv2Packages
options to the options of both services for packages providing lv2 plugins required by filter chains the user set up in their pipewire/wireplumber config files. These get added to theLV2_PATH
of the service they were specified for. In addition, packages inconfigPackages
can specifypassthru.requiredLv2Packages
to have them included in the path as well.In the case of wireplumber, added config and lv2 packages get added for pipewire as well, since config packages for wireplumber are likely to have config files for pipewire as well.
For now my main use case for this is asahi-audio (my setup for that is not yet clean enough to upstream), but I'm sure that as time goes on, other packages will pop up to configure filter chains or similar things. With these options, adding them to nixpkgs should be easy and using them should be easy for users as well.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)I've tested these changes locally with my yet to be upstreamed asahi-audio package and the config files are put in the right places, and lv2 packages are found by wireplumber/pipewire. The existing nixos default config files for pipewire are also present.
Add a 👍 reaction to pull requests you find important.