summaryrefslogtreecommitdiff
path: root/os/core/ssh.nix
diff options
context:
space:
mode:
Diffstat (limited to 'os/core/ssh.nix')
-rw-r--r--os/core/ssh.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/os/core/ssh.nix b/os/core/ssh.nix
new file mode 100644
index 0000000..032bb44
--- /dev/null
+++ b/os/core/ssh.nix
@@ -0,0 +1,27 @@
+{ config, lib, pkgs, ... }:
+let
+ cfg = config.os.core.ssh;
+in
+{
+ options.os.core.ssh.enable = lib.mkEnableOption "enables ssh server setup";
+ config = lib.mkIf cfg.enable {
+ services.tailscale.enable = true;
+
+ services.openssh = {
+ enable = true;
+ PasswordAuthentication = false;
+ KbdInteractiveAuthentication = false;
+ };
+
+ programs.gnupg.agent = {
+ enable = true;
+ enableSSHSupport = true;
+ pinentryPackage = pkgs.pinentry-curses;
+ };
+
+ networking.firewall = {
+ trustedInterfaces = [ "tailscale0" ];
+ allowedUDPPorts = [ 41641 ];
+ };
+ };
+}