nixos-config/profiles/workspace/shadowsocks.nix

25 lines
547 B
Nix
Raw Normal View History

2023-02-22 00:34:25 +04:00
{ 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" ];
};
}