summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2025-08-17 14:10:35 +0530
committersinanmohd <sinan@sinanmohd.com>2025-08-17 14:10:35 +0530
commit6eb29e7c565fe180acb89b580fa2af7441be244c (patch)
tree9799767318495e7c604bfc27cbd96ef5ec14e376 /os
parent19c37ad98086d976cd2546a21193eaafcd5b6b65 (diff)
chore(os/lia): drop sshfwd
Diffstat (limited to 'os')
-rw-r--r--os/lia/configuration.nix1
-rw-r--r--os/lia/modules/sshfwd.nix57
2 files changed, 0 insertions, 58 deletions
diff --git a/os/lia/configuration.nix b/os/lia/configuration.nix
index 27a0959..dd2a13f 100644
--- a/os/lia/configuration.nix
+++ b/os/lia/configuration.nix
@@ -8,7 +8,6 @@
./modules/network
./modules/users.nix
./modules/lxc.nix
- ./modules/sshfwd.nix
];
networking.hostName = "lia";
diff --git a/os/lia/modules/sshfwd.nix b/os/lia/modules/sshfwd.nix
deleted file mode 100644
index b7e8d17..0000000
--- a/os/lia/modules/sshfwd.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{ pkgs, config, ... }:
-let
- mkFwdSrv =
- {
- local_port,
- remote_port,
- remote_user,
- remote ? "sinanmohd.com",
- ssh_port ? 22,
- key ? config.sops.secrets."sshfwd/${remote}".path,
- }:
- {
- "sshfwd-${toString local_port}-${remote}:${toString remote_port}" = {
- description = "Forwarding port ${toString local_port} to ${remote}";
-
- wantedBy = [ "multi-user.target" ];
- after = [ "network-online.target" ];
- wants = [ "network-online.target" ];
- # restart rather than stop+start this unit to prevent
- # the ssh from dying during switch-to-configuration.
- stopIfChanged = false;
-
- serviceConfig = {
- ExecStart = ''
- ${pkgs.openssh}/bin/ssh -N ${remote_user}@${remote} -p ${toString ssh_port} \
- -R '[::]:${toString remote_port}:127.0.0.1:${toString local_port}' \
- -o ServerAliveInterval=15 \
- -o ExitOnForwardFailure=yes \
- -i ${key}
- '';
-
- RestartSec = 3;
- Restart = "always";
- };
-
- };
- };
-in
-{
- sops.secrets."sshfwd/sinanmohd.com" = { };
- sops.secrets."sshfwd/lia.sinanmohd.com" = { };
-
- environment.systemPackages = with pkgs; [ openssh ];
- systemd.services =
- (mkFwdSrv {
- local_port = 22;
- remote_user = "lia";
- remote_port = 2222;
- })
- // (mkFwdSrv {
- local_port = 22;
- remote_port = 22;
- ssh_port = 23;
- remote_user = "root";
- remote = "lia.sinanmohd.com";
- });
-}