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/deluge: add autFile, config and port options #58552

Merged
merged 1 commit into from Jun 4, 2019

Conversation

bricewge
Copy link
Contributor

@bricewge bricewge commented Mar 29, 2019

Motivation for this change

It add multiples options to the deluge service to have a level of configuration similar to transmission: config, ports and auth.

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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@infinisil
Copy link
Member

I don't think this is backwards compatible like this, because previously deluge wasn't passed the -c option, in which case in uses the config file at the default location, which is ~/.config/deluge/core.conf. So by now generating it in NixOS and passing it via -c means everyone's configuration will be reset to the default specified here.

@bricewge
Copy link
Contributor Author

bricewge commented Mar 29, 2019

I changed it to the current config default location /var/lib/deluge/.config/deluge, similar to how it is done in the transmission service.

@infinisil
Copy link
Member

That will just override the users stateful configuration with the one generated by NixOS which is even worse :)

You need to handle the case of users having either stateful or declarative configs. There's multiple ways of doing this:

  • Add a NixOS option services.deluge.declarative, defaulting to false, which tells the module whether it should be declarative or stateful.
  • Only write the declarative file if there's no file there already (or if .declarative exists), and in that case do touch .declarative, indicating that it uses the declarative file. Otherwise output a warning "Warning: Can't use declarative NixOS configuration, stateful configuration already exists at ".

I personally prefer the first one. If you have other ways to solve this, that would work too of course.

@bricewge
Copy link
Contributor Author

I modify the PR to add services.deluge.declarative as you asked, I took inspiration from your commit 58c89ec. Is there anything else missing for it to be merged?

Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

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

(I'm steering you towards the approach in NixOS/rfcs#42)

nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
@bricewge bricewge force-pushed the deluge-auth branch 2 times, most recently from 20a917e to 22f45bb Compare April 1, 2019 17:02
@bricewge
Copy link
Contributor Author

bricewge commented May 5, 2019

@infinisil I think I have made all the modification needed. Can you please review this PR one last time?

nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
@bricewge
Copy link
Contributor Author

@infinisil I have take into account all of your review and kept closed the problematic ports we discussed of. I hope this time it can be merged.

nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
nixos/modules/services/torrent/deluge.nix Outdated Show resolved Hide resolved
@bricewge
Copy link
Contributor Author

bricewge commented Jun 4, 2019

@infinisil Hopefully this is the last time I bother you with this PR.

@infinisil
Copy link
Member

@GrahamcOfBorg test deluge

@infinisil
Copy link
Member

Looking good, thanks for your patience :)

@infinisil infinisil merged commit 08f2e28 into NixOS:master Jun 4, 2019
@bricewge
Copy link
Contributor Author

bricewge commented Jun 4, 2019 via email

@gleber
Copy link
Contributor

gleber commented Aug 31, 2019

@GrahamcOfBorg test deluge

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

4 participants