nixos/go-shadowsocks2: init
This commit is contained in:
parent
e1b208fec6
commit
7f9767954b
|
@ -595,6 +595,7 @@
|
||||||
./services/networking/gdomap.nix
|
./services/networking/gdomap.nix
|
||||||
./services/networking/git-daemon.nix
|
./services/networking/git-daemon.nix
|
||||||
./services/networking/gnunet.nix
|
./services/networking/gnunet.nix
|
||||||
|
./services/networking/go-shadowsocks2.nix
|
||||||
./services/networking/gogoclient.nix
|
./services/networking/gogoclient.nix
|
||||||
./services/networking/gvpe.nix
|
./services/networking/gvpe.nix
|
||||||
./services/networking/hans.nix
|
./services/networking/hans.nix
|
||||||
|
|
30
nixos/modules/services/networking/go-shadowsocks2.nix
Normal file
30
nixos/modules/services/networking/go-shadowsocks2.nix
Normal file
|
@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue