From ec16a3c49429e4581f995a2f8c90eeddba9b5085 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 27 May 2023 21:12:16 +0530 Subject: [PATCH] setup frpc --- hosts/rico2/services/default.nix | 1 + hosts/rico2/services/frpc.nix | 26 ++++++++++++++++++++++++++ secrets.nix | Bin 1264 -> 1360 bytes 3 files changed, 27 insertions(+) create mode 100644 hosts/rico2/services/frpc.nix 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 ee2ec69294fa814c600fda4b419bef34b125e2fe..070ae85e90a565f2698c55c2c374a2d2aae32003 100644 GIT binary patch literal 1360 zcmV-W1+V%5M@dveQdv+`0AMfy2bQ5sI8TbrNH&SKPcFIrsMy z1KC8iPGK@FJgk1=A!&s+gyq1#1}4Ul&nxL{9b3kF7=0;B21X4GG^K}bkQv;u&Xt3^ z?l8{j(>=@5W9NHkdx#mOf8}MuBM|<*T}9t_8a!`>!Htqp#@IH_=pVN=rt(x;UOcSL zbVpc9gsDeD8ysasWqz4Beu6nA6%=2&m!klO&pa`y#@a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