chore(vesuvio): split config into multiple files

This commit is contained in:
uku 2024-12-31 16:06:33 +01:00
parent f5be56222f
commit 250c600a48
Signed by: uku
SSH key fingerprint: SHA256:4P0aN6M8ajKukNi6aPOaX0LacanGYtlfjmN+m/sHY/o
3 changed files with 57 additions and 51 deletions

31
systems/vesuvio/frp.nix Normal file
View file

@ -0,0 +1,31 @@
{ config, _utils, ... }:
let
secrets = _utils.setupSharedSecrets config { secrets = [ "frpToken" ]; };
in
{
imports = [ secrets.generate ];
services.frp = {
enable = true;
role = "server";
settings = {
bindPort = 7000;
auth = {
method = "token";
token = "{{ .Envs.FRP_TOKEN }}";
};
};
};
networking.firewall = {
allowedTCPPorts = [ 22 ]; # forgejo-ssh
allowedTCPPortRanges = [
{
from = 6000;
to = 7000;
}
];
};
systemd.services.frp.serviceConfig.EnvironmentFile = secrets.get "frpToken";
}