From 1114bb3fd12b60d1cf383c57156cbc0b1d7f33a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 30 Oct 2022 19:12:52 +0000 Subject: [PATCH] extract ssh settings for vpsfree --- nixos/boxes/vpsfree1/default.nix | 3 +-- nixos/boxes/vpsfree1/ssh.nix | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 nixos/boxes/vpsfree1/ssh.nix diff --git a/nixos/boxes/vpsfree1/default.nix b/nixos/boxes/vpsfree1/default.nix index 622ea963..4e4563f3 100644 --- a/nixos/boxes/vpsfree1/default.nix +++ b/nixos/boxes/vpsfree1/default.nix @@ -14,11 +14,10 @@ ./matrix-front.nix ./rss.nix ./search.nix + ./ssh.nix ./syncthing-relay.nix ]; - services.openssh.ports = [ 2222 ]; - networking.firewall.allowedTCPPorts = [ 2222 ]; systemd.extraConfig = '' DefaultTimeoutStartSec=900s ''; diff --git a/nixos/boxes/vpsfree1/ssh.nix b/nixos/boxes/vpsfree1/ssh.nix new file mode 100644 index 00000000..5f9ead09 --- /dev/null +++ b/nixos/boxes/vpsfree1/ssh.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: +let port = 2222; +in { + services.openssh = { + enable = true; + ports = [ port ]; + }; + networking.firewall.allowedTCPPorts = [ port ]; +}