summary refs log tree commit diff
path: root/nixos/modules/services/networking
diff options
context:
space:
mode:
authorOkina Matara <okinan@chiru.no>2018-09-08 12:12:11 -0500
committerOkina Matara <okinan@chiru.no>2018-09-08 12:12:11 -0500
commit9c97f37761a5eaa7387aabcd2c3cc631a2b712a3 (patch)
tree9defe28f9bc7600d9b6858ae16744c9046a1c062 /nixos/modules/services/networking
parentb58a230c60c31effd8eac43cb3a88d172ee19b71 (diff)
downloadnixlib-9c97f37761a5eaa7387aabcd2c3cc631a2b712a3.tar
nixlib-9c97f37761a5eaa7387aabcd2c3cc631a2b712a3.tar.gz
nixlib-9c97f37761a5eaa7387aabcd2c3cc631a2b712a3.tar.bz2
nixlib-9c97f37761a5eaa7387aabcd2c3cc631a2b712a3.tar.lz
nixlib-9c97f37761a5eaa7387aabcd2c3cc631a2b712a3.tar.xz
nixlib-9c97f37761a5eaa7387aabcd2c3cc631a2b712a3.tar.zst
nixlib-9c97f37761a5eaa7387aabcd2c3cc631a2b712a3.zip
nixos/zeronet: Fix TOR permissions, add torAlways option
Diffstat (limited to 'nixos/modules/services/networking')
-rw-r--r--nixos/modules/services/networking/zeronet.nix20
1 files changed, 16 insertions, 4 deletions
diff --git a/nixos/modules/services/networking/zeronet.nix b/nixos/modules/services/networking/zeronet.nix
index 2377cb2c8f11..8b60799891ca 100644
--- a/nixos/modules/services/networking/zeronet.nix
+++ b/nixos/modules/services/networking/zeronet.nix
@@ -12,6 +12,8 @@ let
       log_dir = ${cfg.logDir}
     '' + lib.optionalString (cfg.port != null) ''
       ui_port = ${toString cfg.port}
+    '' + lib.optionalString (cfg.torAlways) ''
+      tor = always
     '' + cfg.extraConfig;
   };
 in with lib; {
@@ -35,13 +37,19 @@ in with lib; {
     port = mkOption {
       type = types.nullOr types.int;
       default = null;
-      example = 15441;
-      description = "Optional zeronet port.";
+      example = 43110;
+      description = "Optional zeronet web UI port.";
     };
 
     tor = mkOption {
       type = types.bool;
       default = false;
+      description = "Use TOR for zeronet traffic where possible.";
+    };
+
+    torAlways = mkOption {
+      type = types.bool;
+      default = false;
       description = "Use TOR for all zeronet traffic.";
     };
 
@@ -60,9 +68,13 @@ in with lib; {
     services.tor = mkIf cfg.tor {
       enable = true;
       controlPort = 9051;
-      extraConfig = "CookieAuthentication 1";
+      extraConfig = ''
+        CacheDirectoryGroupReadable 1
+        CookieAuthentication 1
+        CookieAuthFileGroupReadable 1
+      '';
     };
-    
+
     systemd.services.zeronet = {
       description = "zeronet";
       after = [ "network.target" (optionalString cfg.tor "tor.service") ];