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

feat(extractors/services): Add support for Tor #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions icons/services/tor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions nixos/extractors/services.nix
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,15 @@ in {
details.listen.text = "${config.services.tabby.host}:${toString config.services.tabby.port}";
};

tor = let
_tor = config.services.tor;
in
mkIf _tor.enable {
name = "Tor";
icon = "services.tor";
info = optionalString _tor.relay.enable "Role: ${_tor.relay.role}";
Copy link
Owner

Choose a reason for hiding this comment

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

can we make this an mkIf then users can set info without mkForce if the relay is not enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to replicate erroneous behavior when setting info, while the relay option is disabled, however everything worked correctly even without mkForce. So there is no need?
What is interesting though is I found out that the strings get concatenated when the relay is enabled.
Let's say:

topology.self.services.tor = "lol";

In the node running tor, where a relay is enabled as role = "relay";
would lead to the info being Role: relay lol". Is that intended?

};

traefik = let
dynCfg = config.services.traefik.dynamicConfigOptions;
in
Expand Down