summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorHenri Menke <henrimenke@gmail.com>2020-09-09 09:50:00 +1200
committerBenno Fünfstück <benno.fuenfstueck@gmail.com>2020-09-14 22:35:05 +0200
commite587b5a8a843b296ec6293bc7684fb7856773f71 (patch)
tree017713e8baef09ac52ef4bda1c8656ae179123fd /nixos/modules
parent0023908b4ecef4e889a9bb524394f53c014950fe (diff)
downloadnixpkgs-e587b5a8a843b296ec6293bc7684fb7856773f71.tar
nixpkgs-e587b5a8a843b296ec6293bc7684fb7856773f71.tar.gz
nixpkgs-e587b5a8a843b296ec6293bc7684fb7856773f71.tar.bz2
nixpkgs-e587b5a8a843b296ec6293bc7684fb7856773f71.tar.lz
nixpkgs-e587b5a8a843b296ec6293bc7684fb7856773f71.tar.xz
nixpkgs-e587b5a8a843b296ec6293bc7684fb7856773f71.tar.zst
nixpkgs-e587b5a8a843b296ec6293bc7684fb7856773f71.zip
nixos/shadowsocks: add extraConfig
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/networking/shadowsocks.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/shadowsocks.nix b/nixos/modules/services/networking/shadowsocks.nix
index 4fd988297f6..6009a91cbb2 100644
--- a/nixos/modules/services/networking/shadowsocks.nix
+++ b/nixos/modules/services/networking/shadowsocks.nix
@@ -17,7 +17,7 @@ let
     plugin_opts = cfg.pluginOpts;
   } // optionalAttrs (cfg.password != null) {
     password = cfg.password;
-  };
+  } // cfg.extraConfig;
 
   configFile = pkgs.writeText "shadowsocks.json" (builtins.toJSON opts);
 
@@ -112,6 +112,24 @@ in
           Options to pass to the plugin if one was specified
         '';
       };
+
+      extraConfig = mkOption {
+        type = types.attrs;
+        default = {};
+        example = ''
+          {
+            nameserver = "8.8.8.8";
+          }
+        '';
+        description = ''
+          Additional configuration for shadowsocks that is not covered by the
+          provided options. The provided attrset will be serialized to JSON and
+          has to contain valid shadowsocks options. Unfortunately most
+          additional options are undocumented but it's easy to find out what is
+          available by looking into the source code of
+          <link xlink:href="https://github.com/shadowsocks/shadowsocks-libev/blob/master/src/jconf.c"/>
+        '';
+      };
     };
 
   };