···1717 plugin_opts = cfg.pluginOpts;
1818 } // optionalAttrs (cfg.password != null) {
1919 password = cfg.password;
2020- };
2020+ } // cfg.extraConfig;
21212222 configFile = pkgs.writeText "shadowsocks.json" (builtins.toJSON opts);
2323···110110 example = "server;host=example.com";
111111 description = ''
112112 Options to pass to the plugin if one was specified
113113+ '';
114114+ };
115115+116116+ extraConfig = mkOption {
117117+ type = types.attrs;
118118+ default = {};
119119+ example = ''
120120+ {
121121+ nameserver = "8.8.8.8";
122122+ }
123123+ '';
124124+ description = ''
125125+ Additional configuration for shadowsocks that is not covered by the
126126+ provided options. The provided attrset will be serialized to JSON and
127127+ has to contain valid shadowsocks options. Unfortunately most
128128+ additional options are undocumented but it's easy to find out what is
129129+ available by looking into the source code of
130130+ <link xlink:href="https://github.com/shadowsocks/shadowsocks-libev/blob/master/src/jconf.c"/>
113131 '';
114132 };
115133 };