-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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/tor: add HiddenServiceVersion option #50950
Merged
joachifm
merged 1 commit into
NixOS:master
from
jonasnick:nixos-tor-hiddenservice-version
Nov 24, 2018
Merged
nixos/tor: add HiddenServiceVersion option #50950
joachifm
merged 1 commit into
NixOS:master
from
jonasnick:nixos-tor-hiddenservice-version
Nov 24, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GrahamcOfBorg
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/`
10.rebuild-darwin: 0
This PR does not cause any packages to rebuild on Darwin
10.rebuild-linux: 1-10
labels
Nov 23, 2018
type = types.addCheck (types.nullOr types.int) (x: x == 2 || x == 3);
I think it should be
type = types.nullOr (types.addCheck types.int (x: x == 2 || x == 3));
(Btw, grepping shows `nixos/modules/services/misc/rippled.nix` does a similar wrong thing. I fixed that one myself and added the patch to the queue.)
Also, after reading #50849 (review) I'm now also a bit torn on whenever the default should be left to tor via `null`s, via `isDefined` or at all. But I'd say it's fine as it is.
|
jonasnick
force-pushed
the
nixos-tor-hiddenservice-version
branch
from
November 23, 2018 20:28
3c5afa9
to
1f3cf2f
Compare
Good catch. I fixed that. Actually I found the construction in rippled.nix and then didn't think about it. |
infinisil
requested changes
Nov 23, 2018
version = mkOption { | ||
default = null; | ||
description = "Rendezvous service descriptor version to publish for the hidden service. Currently, versions 2 and 3 are supported. (Default: 2)"; | ||
type = types.nullOr (types.addCheck types.int (x: x == 2 || x == 3)); |
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 type revision:
types.nullOr (types.enum [ 2 3 ])
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.
Makes sense. Done.
jonasnick
force-pushed
the
nixos-tor-hiddenservice-version
branch
from
November 23, 2018 20:53
1f3cf2f
to
5640aa2
Compare
infinisil
approved these changes
Nov 23, 2018
LGTM.
|
Janik-Haag
added
the
12. first-time contribution
This PR is the author's first one; please be gentle!
label
Jun 12, 2023
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!
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
Allows to easily use v3 Hidden Services which "features many improvements over the legacy system". Due to the torrc syntax that seems difficult to do without adding a hidden service version option to the module.
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)