nixos/tor: use cfg.package instead of pkgs.tor, add obfs4Package option (#461333)

This commit is contained in:
Felix Bargfeldt
2025-11-13 22:02:47 +00:00
committed by GitHub

View File

@@ -456,6 +456,8 @@ in
package = lib.mkPackageOption pkgs "tor" { };
obfs4Package = lib.mkPackageOption pkgs "obfs4" { };
enableGeoIP =
lib.mkEnableOption ''
use of GeoIP databases.
@@ -1253,7 +1255,7 @@ in
BridgeRelay = true;
ExtORPort.port = lib.mkDefault "auto";
ServerTransportPlugin.transports = lib.mkDefault [ "obfs4" ];
ServerTransportPlugin.exec = lib.mkDefault "${lib.getExe pkgs.obfs4} managed";
ServerTransportPlugin.exec = lib.mkDefault "${lib.getExe cfg.obfs4Package} managed";
}
// lib.optionalAttrs (cfg.relay.role == "private-bridge") {
ExtraInfoStatistics = false;
@@ -1326,7 +1328,7 @@ in
systemd.services.tor = {
description = "Tor Daemon";
documentation = [ "man:tor(8)" ];
path = [ pkgs.tor ];
path = [ cfg.package ];
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];