blob: 55c779dda18137e01b8ff5e5354e0fe2887fc969 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
{
config,
lib,
pkgs,
...
}:
let
cfg = config.os.srv.tor;
in
{
options.os.srv.tor = {
enable = lib.mkEnableOption "enables tor services";
enableBrowser = lib.mkEnableOption "enables the tor browser";
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
services.tor = {
enable = true;
client = {
enable = true;
dns.enable = true;
transparentProxy.enable = true;
};
settings = {
Sandbox = true;
DisableAllSwap = true;
};
};
})
(lib.mkIf cfg.enableBrowser {
environment.systemPackages = [ pkgs.tor-browser ];
})
];
}
|