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/transmission: make user configurable #67393

Merged

Conversation

c0deaddict
Copy link
Member

@c0deaddict c0deaddict commented Aug 24, 2019

Motivation for this change

Wanted to run a Transmission daemon under a different user than the default transmission. Added the user and group configuration options to do this (defaults to user and group = transmission). Used the same pattern as other packages that add the user/group only if the default is given [1]

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 nix-review --run "nix-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @astsmtl @vcunat @wizeman

@pstch
Copy link
Contributor

pstch commented Aug 24, 2019

Reviewed points
  • changes are backward compatible
    _(the default value is the old static value, so there is no change at all by default)
  • removed options are declared with mkRemovedOptionModule
    (no removed change)
  • changes that are not backward compatible are documented in release notes
    (no such change)
  • module tests succeed on darwin/linux
  • options types are appropriate
  • options description is set
  • options example is provided
    (not provided, but .user options seem to not have examples in general)
  • documentation affected by the changes is updated
    (no documentation for this package in manual)
Possible improvements
  • Include package name in the added options, as existing descriptions for .user (and .group) options mention the name of the service. Suggestion: "User account under which Transmission runs.", as this pattern seems to be used a lot.
Comments
  • I have just started trying to help review nixpkgs PRs, so this review should be taken with a grain of salt, as I may have misunderstood and missed things (I hope not).

@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-already-reviewed/2617/54

@aanderse
Copy link
Member

Wanted to run a Transmission daemon under a different user than the default transmission.

Which user?

@c0deaddict c0deaddict force-pushed the feature/transmission-user-configurable branch from 79a015e to c3e93d5 Compare August 25, 2019 11:20
@c0deaddict
Copy link
Member Author

c0deaddict commented Aug 25, 2019

@pstch Thanks for your review! I've incorporated the change to the description you suggested.

@aanderse I'm running Transmission (together with Sonarr, Radarr and Jackett) in a NixOS container which also runs an OpenVPN client. My downloads directory is mounted from the host to the container and transmission is configured to run in an user account that is also present on the host system. I would have preferred a user mapping on the container level, but the OpenVPN client requires root.

@aanderse
Copy link
Member

@c0deaddict a system user account, or a regular user account for a person? I'm trying to head off people running systemd system level services as regular user accounts because services running as regular user accounts should usually be run as systemd user level services. We've run into some problems when people configure user options as their own account and I believe we'll run into more. There is no policy or preferred way to code something like this yet, so I can't point you in the right direction... I'm just trying to keep an eye out for more problems.

@c0deaddict
Copy link
Member Author

A system user account (named downloads), and in a group of which my user is also a member so that I can also access the files (it's running on my NAS). I get the issue, and am aware of systemd user services. It would be nice if there was a way to unify NixOS services and home-manager, so services defined here could also be run as systemd user level services from home-manager.

Copy link
Member

@timokau timokau left a comment

Choose a reason for hiding this comment

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

@aanderse I get the possible footgun, but the use-case also seems valid to me. And since there's already plenty of examples of this in nixpkgs, I think there's no use in selectively applying a new policy here. Maybe documentation improvements could help.

So I'm in favor of merging. If you don't disagree. Thanks @pstch for the extensive review!

@aanderse
Copy link
Member

@timokau I wasn't meaning to imply I was against this PR. I have the thumbs up on the most recent reply to show my support. I think this change is fine and it's a bonus that the issue is understood by all involved here.

@aanderse aanderse merged commit 5b8c229 into NixOS:master Aug 25, 2019
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

5 participants