nixos-config/profiles/workspace/shadowsocks.nix
2023-02-22 00:34:25 +04:00

25 lines
547 B
Nix

{ config, pkgs, ... }: {
secrets.shadowsocks_options = {
owner = "shadowsocks:shadowsocks";
services = [ "shadowsocks" ];
};
users.users.shadowsocks = {
isSystemUser = true;
group = "shadowsocks";
};
users.groups.shadowsocks = { };
systemd.services.shadowsocks = {
script = "ss-local -l 5555 $(cat ${config.secrets.shadowsocks_options})";
path = [ pkgs.shadowsocks-libev ];
serviceConfig = {
User = "shadowsocks";
Group = "shadowsocks";
};
wantedBy = [ "multi-user.target" ];
};
}