diff --git a/hosts/rico2/services/default.nix b/hosts/rico2/services/default.nix index 12f6d65..b0d13d0 100644 --- a/hosts/rico2/services/default.nix +++ b/hosts/rico2/services/default.nix @@ -1,3 +1,4 @@ {...}: { + imports = [./frpc.nix]; services.openssh.enable = true; } diff --git a/hosts/rico2/services/frpc.nix b/hosts/rico2/services/frpc.nix new file mode 100644 index 0000000..d457cae --- /dev/null +++ b/hosts/rico2/services/frpc.nix @@ -0,0 +1,26 @@ +{pkgs, ...}: let + frp_config = (import ../../../secrets.nix).frp_config; +in { + systemd.services.frpc = { + enable = true; + description = "FRP Client"; + wantedBy = ["multi-user.target"]; + requires = ["network.target"]; + path = [ + pkgs.frp + ]; + script = "frpc -c /etc/frp/frpc.ini"; + }; + 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 + ''; +} diff --git a/secrets.nix b/secrets.nix index ee2ec69..070ae85 100644 Binary files a/secrets.nix and b/secrets.nix differ