Skip to content

Commit

Permalink
nixos/shadowsocks: add extraConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
hmenke authored and bennofs committed Sep 14, 2020
1 parent 0023908 commit e587b5a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion nixos/modules/services/networking/shadowsocks.nix
Expand Up @@ -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);

Expand Down Expand Up @@ -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"/>
'';
};
};

};
Expand Down

0 comments on commit e587b5a

Please sign in to comment.