21 lines
566 B
Nix
21 lines
566 B
Nix
{ pkgs, ... }:
|
|
|
|
{
|
|
systemd.user.services.hysteria-proxy = {
|
|
Unit.Description = "Shadowsocks proxy service";
|
|
Install.WantedBy = [ "default.target" ];
|
|
Service = {
|
|
Restart = "always";
|
|
ExecStart = "${pkgs.writeShellScript "hysteria-service-start" ''
|
|
#!/run/current-system/sw/bin/bash
|
|
${pkgs.hysteria}/bin/hysteria -c ${./hysteria.yml}
|
|
''}";
|
|
ExecStop = "${pkgs.writeShellScript "hysteria-service-stop" ''
|
|
#!/run/current-system/sw/bin/bash
|
|
${pkgs.toybox}/bin/killall hysteria
|
|
''}";
|
|
|
|
};
|
|
};
|
|
}
|