diff options
author | geistesk <github.jyf300hj@0x21.biz> | 2019-08-26 19:39:36 +0200 |
---|---|---|
committer | geistesk <github.jyf300hj@0x21.biz> | 2019-10-06 11:18:20 +0200 |
commit | 7f9767954bf77d537f6bd6102c419d716b41be45 (patch) | |
tree | 91af3ebca0aaec6d82fc2c0c578e37a66a9c40de | |
parent | e1b208fec60ff22b2b48e4a2a48d0f272ede0b6a (diff) |
nixos/go-shadowsocks2: init
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/networking/go-shadowsocks2.nix | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 40f4d4ad4d062..cf77bf1464ce8 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -595,6 +595,7 @@ ./services/networking/gdomap.nix ./services/networking/git-daemon.nix ./services/networking/gnunet.nix + ./services/networking/go-shadowsocks2.nix ./services/networking/gogoclient.nix ./services/networking/gvpe.nix ./services/networking/hans.nix diff --git a/nixos/modules/services/networking/go-shadowsocks2.nix b/nixos/modules/services/networking/go-shadowsocks2.nix new file mode 100644 index 0000000000000..afbd7ea27c65c --- /dev/null +++ b/nixos/modules/services/networking/go-shadowsocks2.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.services.go-shadowsocks2.server; +in { + options.services.go-shadowsocks2.server = { + enable = mkEnableOption "go-shadowsocks2 server"; + + listenAddress = mkOption { + type = types.str; + description = "Server listen address or URL"; + example = "ss://AEAD_CHACHA20_POLY1305:your-password@:8488"; + }; + }; + + config = mkIf cfg.enable { + systemd.services.go-shadowsocks2-server = { + description = "go-shadowsocks2 server"; + + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + ExecStart = "${pkgs.go-shadowsocks2}/bin/go-shadowsocks2 -s '${cfg.listenAddress}'"; + DynamicUser = true; + }; + }; + }; +} |