-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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/shairport-sync: fix dbus support #276693
base: master
Are you sure you want to change the base?
Conversation
Adds a policy (based off upstream's) that allows root and the configured user to own/use the main service and MPRIS interface. Note that the upstream policies cannot be directly used because we allow configuring the user.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/3159 |
@@ -6,6 +6,37 @@ let | |||
|
|||
cfg = config.services.shairport-sync; | |||
|
|||
# This is based off the upstream versions, but they can't be used directly because |
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.
Could we easily patch it or would that complicate the build to much?
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.
It's a tad more involved. shairport-sync
is built with --without-configfiles
meaning the dbus and sample config files aren't installed.
Compiling without --without-configfiles
requires a patch to the build system (I have all this in a branch somewhere, just not on this pc otherwise I'd paste it).
Then there's actually two dbus policies:
- DBUS - https://github.com/mikebrady/shairport-sync/blob/master/scripts/shairport-sync-dbus-policy.conf
- MPRIS - https://github.com/mikebrady/shairport-sync/blob/master/scripts/shairport-sync-mpris-policy.conf
I've merged them into a single file in this PR.
Patching them is probably a simple s/shairport-sync/${user}/g
, but I haven't checked.
Another option is to simply remove the ability to set the user/group, and force it to shairport-sync
so the upstream policies can be used directly.
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.
@SuperSandro2000 here's what I mean: vs49688@b0293d2
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.
Do you think you can fix the double prefix issue at its core?
Patching them is probably a simple s/shairport-sync/${user}/g, but I haven't checked.
That would be really simple.
Another option is to simply remove the ability to set the user/group, and force it to shairport-sync so the upstream policies can be used directly.
I am not sure what other people think but if upstream doesn't support it either, that might make things just way easier.
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.
How's this?
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.
Another option is to simply remove the ability to set the user/group, and force it to shairport-sync so the upstream policies can be used directly.
I am not sure what other people think but if upstream doesn't support it either, that might make things just way easier.
I would be 100% for this, just to keep things simple.
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.
How's this?
Nice. Could you update the PR?
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.
I can, or we could wait until mikebrady/shairport-sync#1782 is merged and remove the patch altogether.
Description of changes
Adds a policy (based off upstream's) that allows root and the configured user to own/use the main service and MPRIS interface.
Note that the upstream policies cannot be directly used because we allow configuring the user.
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/
)Add a 👍 reaction to pull requests you find important.