1 { config, lib, pkgs, ... }:
3 cfg = config.services.go-shadowsocks2.server;
5 options.services.go-shadowsocks2.server = {
6 enable = lib.mkEnableOption "go-shadowsocks2 server";
8 listenAddress = lib.mkOption {
10 description = "Server listen address or URL";
11 example = "ss://AEAD_CHACHA20_POLY1305:your-password@:8488";
15 config = lib.mkIf cfg.enable {
16 systemd.services.go-shadowsocks2-server = {
17 description = "go-shadowsocks2 server";
19 after = [ "network.target" ];
20 wantedBy = [ "multi-user.target" ];
23 ExecStart = "${pkgs.go-shadowsocks2}/bin/go-shadowsocks2 -s '${cfg.listenAddress}'";