2023-05-27 21:12:16 +05:30
|
|
|
{pkgs, ...}: let
|
|
|
|
frp_config = (import ../../../secrets.nix).frp_config;
|
|
|
|
in {
|
|
|
|
systemd.services.frpc = {
|
|
|
|
enable = true;
|
|
|
|
description = "FRP Client";
|
2023-05-29 23:20:18 +05:30
|
|
|
after = ["network.target"];
|
2023-05-27 21:12:16 +05:30
|
|
|
requires = ["network.target"];
|
2023-05-29 23:20:18 +05:30
|
|
|
wantedBy = ["multi-user.target"];
|
|
|
|
serviceConfig = {
|
|
|
|
Type="simple";
|
|
|
|
ExecStart="${pkgs.frp}/bin/frpc -c /etc/frp/frpc.ini";
|
|
|
|
Restart="always";
|
|
|
|
RestartSec="5s";
|
|
|
|
};
|
2023-05-27 21:12:16 +05:30
|
|
|
};
|
|
|
|
environment.etc."frp/frpc.ini".text = ''
|
|
|
|
[common]
|
|
|
|
server_addr = "${frp_config.ip}"
|
|
|
|
server_port = 7000
|
|
|
|
authentication_method = token
|
|
|
|
token = "${frp_config.token}"
|
|
|
|
|
|
|
|
[ssh.rico2]
|
|
|
|
type = tcp
|
|
|
|
local_port = 22
|
|
|
|
remote_port = 6002
|
|
|
|
'';
|
|
|
|
}
|