2024-10-08 20:16:26 +04:00
|
|
|
{ outputs, options, config, lib, pkgs, ... }:
|
|
|
|
let cfg = config.modules.security.tor;
|
|
|
|
in {
|
|
|
|
options.modules.security.tor = { enable = lib.mkEnableOption false; };
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2024-10-08 20:18:16 +04:00
|
|
|
|
2024-10-09 06:29:58 +04:00
|
|
|
age.secrets.torrc = {
|
|
|
|
file = ../../secrets/shared/torrc.age;
|
|
|
|
owner = "tor";
|
|
|
|
group = "tor";
|
|
|
|
};
|
|
|
|
|
2024-10-08 20:18:16 +04:00
|
|
|
users.users.sako.packages = with pkgs; [ tor-browser ];
|
|
|
|
|
2024-10-08 20:16:26 +04:00
|
|
|
services.tor = {
|
|
|
|
enable = true;
|
|
|
|
torsocks.enable = true;
|
|
|
|
client = { enable = true; };
|
|
|
|
};
|
2024-10-09 06:29:58 +04:00
|
|
|
|
|
|
|
environment.etc = { "tor/torrc".source = config.age.secrets.torrc.path; };
|
|
|
|
|
2024-10-08 20:16:26 +04:00
|
|
|
};
|
|
|
|
}
|