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 tor hidden service options #28081
Conversation
This change allows to configure hidden services more conveniently.
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.
Looks fine but see my comments.
mkHiddenServicePort = hsport: let | ||
trgt = if (hsport.target != null) then | ||
" " + hsport.target | ||
else ""; |
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.
This could be simplified like:
trgt = optionalString (hsport.target != null) (" " + hsport.target)
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.
The following wins the golfing challenge:
trgt = '' ${hsport . target or ""}''
description = '' | ||
Configure hidden services. | ||
|
||
Please consult the tor manual (<literal>man tor</literal>) for a more |
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.
This is rendered with docbook, so for referencing manpages you could use:
<citerefentry><refentrytitle>tor</refentrytitle><manvolnum>1</manvolnum></citerefentry>
Also use more elegant optionalString for optional strings.
This should do. I applied the docbook syntax to the previously existing documentation as well. |
a path below /var/lib/tor is usually used for hidden services
Motivation for this change
Having to configure tor hidden services via the
extraConfig
did not look as nice in the configuration.This change allows to configure hidden services more conveniently.
Things done
Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers.
Since all changes are only related to generating torrc files i tested it on my local machine.
I was able to generate valid torrc files and host hidden services using those.
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)