-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
plex: rewrite to use FHS userenv #56565
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
Conversation
c8b2ca2
to
47ae659
Compare
This is probably the way to go with Plex. To use any of the Plex Pass features I had to create an Ubuntu VM. I'd rather run it in a NixOS container and this looks like a move in the right direction. |
This looks good to me and works with my existing library. Thank you for taking this over, I am excited to see this merged! |
47ae659
to
8d1f1ec
Compare
I'll wait for one of the actual package maintainers to chime in before merging, but this looks pretty good to me. |
8d1f1ec
to
186f3a1
Compare
186f3a1
to
6ca8bb3
Compare
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 tried to run this against the current nixos-unstable-small
(eb2a26f5c61) channel.
The service won't start:
Mar 15 22:39:37 odin systemd[1]: Started Plex Media Server.
Mar 15 22:39:37 odin plexmediaserver[29398]: /nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Mar 15 22:39:37 odin plexmediaserver[29398]: terminate called after throwing an instance of 'std::runtime_error'
Mar 15 22:39:37 odin plexmediaserver[29398]: what(): locale::facet::_S_create_c_locale name not valid
Mar 15 22:39:37 odin systemd[1]: plex.service: Main process exited, code=killed, status=6/ABRT
Mar 15 22:39:37 odin systemd[1]: plex.service: Failed with result 'signal'.
Mar 15 22:39:38 odin systemd[1]: plex.service: Service RestartSec=100ms expired, scheduling restart.
Mar 15 22:39:38 odin systemd[1]: plex.service: Scheduled restart job, restart counter is at 5.
Mar 15 22:39:38 odin systemd[1]: Stopped Plex Media Server.
I'm not sure this is related to this PR as I got a similar issue with LOCALE
while using python 3 in a FHSEnv. #56347 might be related.
6ca8bb3
to
484e577
Compare
I rebased this thogether with all the other commits missing to make it working: https://github.com/bachp/nixpkgs/tree/plexfhs-fhsfixes
|
@andrew-d This now works out of the box on master. You can use my rebased version from https://github.com/bachp/nixpkgs/tree/plexfhs-fhsfixes that solves the merge conflict by updating the plex version. |
484e577
to
0a342ca
Compare
@bachp - Okay, rebased this on master, which I think should have fixed merge conflicts. Thank you for all your help with the locale issues! |
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.
With the latest rebase it works out of the box, even on top os nixos-unstable-small
.
Is there a reson this doesn't get merged? Rebased version without conflict: https://github.com/bachp/nixpkgs/tree/plexfhs-fhsfixes |
0a342ca
to
9f7f367
Compare
@bachp - Rebased on |
Any known remaining blockers to merging this? I'm not sure whose approval we're waiting for here |
@GrahamcOfBorg eval (though I suppose it'll error on non-free software) |
@grahamc - Thank you very much; greatly appreciated! |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation for this change
This PR attempts to rewrite the Plex derivation and NixOS module to use
buildFHSUserEnv
. Plex downloads binary codecs from the internet and runs them, and this prevents errors when that happens. This PR is an alternative to #48506 that maintains compatibility with the previous PlexdataDir
option.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)Remaining questions
dataDir
in$HOME
if none is given to the FHS userenv, since that feels less likely to break without running as elevated permisisons (though the NixOS module keeps the previous default). Does this make sense?plex
/plexRaw
split that still allows overridingplexRaw.src
for Plex Pass users?cc @yegortimoshenko @colemickens @dywedir @Forkk @LnL7 @pjones @thoughtpolice