mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 14:43:37 +00:00
31 lines
755 B
Nix
31 lines
755 B
Nix
{ 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;
|
|
};
|
|
};
|
|
};
|
|
}
|