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/jellyfin: add directory options #277220

Merged
merged 3 commits into from
Feb 12, 2024
Merged

Conversation

fsnkty
Copy link
Member

@fsnkty fsnkty commented Dec 28, 2023

Description of changes

add dataDir configDir cacheDir and logDir options

ideally a lot of config and data dirs would be declared in some way, but the ability to easily define their locations is nicer than nothing.
the webdir option explained here is as far as i know not relevant given its in the store.

this should replace PR #233617 ( I've tried to address the unresolved comments here )
it should also close #141367 as a result.

removed with lib; to address #208242 for this module.

add meta.mainProgram to the jellyfin server package so that getExe can be used appropriately.

remove use of the now pointless lib.mdDoc

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Dec 28, 2023
@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Dec 28, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Dec 28, 2023
@fsnkty fsnkty force-pushed the nixos-jellyfin-dirs branch 2 times, most recently from 8727c80 to 3456727 Compare December 28, 2023 02:27
@rasmus-kirk rasmus-kirk mentioned this pull request Dec 30, 2023
13 tasks
@fsnkty fsnkty force-pushed the nixos-jellyfin-dirs branch 3 times, most recently from 4485454 to 0f1ec08 Compare January 1, 2024 23:27
nixos/modules/services/misc/jellyfin.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/jellyfin.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/jellyfin.nix Outdated Show resolved Hide resolved
@fsnkty fsnkty force-pushed the nixos-jellyfin-dirs branch 3 times, most recently from ffec5b1 to d943091 Compare January 3, 2024 02:25
@fsnkty
Copy link
Member Author

fsnkty commented Jan 3, 2024

Welp I struggled with that more than I'd like to have been shown lol. Lesson learnt, test locally always 😵‍💫

also TIL you can merge suggestions right from within GitHubs website.

unrelated question, can you preserve the commit messages of commits which must be squashed? the last few force pushes now feel silly without any immediate context.

@fsnkty fsnkty force-pushed the nixos-jellyfin-dirs branch from d943091 to 5ca2a74 Compare January 3, 2024 03:21
@fsnkty
Copy link
Member Author

fsnkty commented Jan 3, 2024

somewhere in this process I've managed to break the service.

Jan 03 16:16:44 library (jellyfin)[24592]: jellyfin.service: Changing to the requested working directory failed: Permission denied
Jan 03 16:16:44 library (jellyfin)[24592]: jellyfin.service: Failed at step CHDIR spawning /nix/store/0d8ji5b45v59n7179pvg8a4ci7044qj7-jellyfin-10.8.13/bin/jellyfin: Permission denied

persists when state is removed and is a problem with another user trying to use this PR. this was working before my first push today.

@fsnkty
Copy link
Member Author

fsnkty commented Jan 3, 2024

somewhere in this process I've managed to break the service.

Jan 03 16:16:44 library (jellyfin)[24592]: jellyfin.service: Changing to the requested working directory failed: Permission denied
Jan 03 16:16:44 library (jellyfin)[24592]: jellyfin.service: Failed at step CHDIR spawning /nix/store/0d8ji5b45v59n7179pvg8a4ci7044qj7-jellyfin-10.8.13/bin/jellyfin: Permission denied

persists when state is removed and is a problem with another user trying to use this PR. this was working before my first push today.

removing the workingDir line moves the issue to some permissions faults with the log directory.
I've attempted to set the permissions to 770 and the umask of the service to 0770 to no avail.

converting to a draft till I can find the issue here, any insight is greatly appreciated.

@fsnkty fsnkty marked this pull request as draft January 3, 2024 04:17
@fsnkty fsnkty force-pushed the nixos-jellyfin-dirs branch from 5ca2a74 to 46a2193 Compare January 4, 2024 19:48
@fsnkty
Copy link
Member Author

fsnkty commented Jan 4, 2024

In that latest force-push I removed privateUsers = true something I'm not super confident about.
my reasoning is that it was the only option that would cause the services permission errors to read from directorys within the base dir, such as log and config. even with 770 permissions applied.
I'd appreciate insight on the potential consequences of this if any as this resource didn't help me understand much.

I also added more links to jellyfin documentation using some markdown after finding out that was available.
I'll have one more force push to cleanup a formatting mistake I left in from testing and then I'll move the PR out of a draft again.

@fsnkty fsnkty force-pushed the nixos-jellyfin-dirs branch from 46a2193 to f413456 Compare January 4, 2024 19:59
@fsnkty fsnkty marked this pull request as ready for review January 4, 2024 20:00
@fsnkty fsnkty force-pushed the nixos-jellyfin-dirs branch from f413456 to 2253842 Compare January 4, 2024 23:50
@nixos-discourse
Copy link

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/3264

Copy link
Member

@nevivurn nevivurn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PrivateUsers makes other users (not root or jellyfin) invisible to this unit. Jellyfin should work with it enabled, so this is a (minor) regression and should be fixed, imo.

nixos/modules/services/misc/jellyfin.nix Outdated Show resolved Hide resolved
@fsnkty fsnkty force-pushed the nixos-jellyfin-dirs branch from 2253842 to 1feaec1 Compare January 20, 2024 21:07
Copy link
Member

@nevivurn nevivurn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

@fsnkty
Copy link
Member Author

fsnkty commented Jan 20, 2024

given the PR this replaces had some users preemptively using the changes I'll leave this here as reference for how I've been testing / making use of the changes myself.

small update to this, cant recommend using the jellyfin(package) ver from this on unstable since some changes have borked hw transcodes with it, will be fine once merged of course.

@fsnkty fsnkty force-pushed the nixos-jellyfin-dirs branch from 31f884d to 475b760 Compare January 26, 2024 11:03
@fsnkty
Copy link
Member Author

fsnkty commented Jan 26, 2024

latest force push was simply to ensure exact permissions lineup with whats current.
previous was non problematic but also uselessly open for the group with 750, corrected to 700
( there must be a better way to comment on this stuff with the github ui)

@NotAShelf
Copy link
Member

I thought using mdDoc was a no-op as documentation now uses markdown by default?

@eclairevoyant
Copy link
Contributor

eclairevoyant commented Feb 5, 2024

I thought using mdDoc was a no-op as documentation now uses markdown by default?

Correct, since d36f950 (#237557) which was merged in June 2023:

nixpkgs/lib/options.nix

Lines 384 to 387 in 0a25418

/* Transition marker for documentation that's already migrated to markdown
syntax. This is a no-op and no longer needed.
*/
mdDoc = lib.id;

Any uses of mdDoc can be removed.

Copy link
Contributor

@drupol drupol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@NotAShelf NotAShelf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@drupol drupol merged commit 2d627a2 into NixOS:master Feb 12, 2024
27 checks passed
@fsnkty fsnkty deleted the nixos-jellyfin-dirs branch February 13, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jellyfin: add dataDir option