From fec9e1871061e66d7d662022a83f817e2584afba Mon Sep 17 00:00:00 2001 From: smayzy Date: Sat, 9 Aug 2025 13:19:45 +0200 Subject: [PATCH] add openssh --- modules/nix/default.nix | 1 + modules/nix/networking/default.nix | 6 ++++++ modules/nix/networking/openssh.nix | 25 +++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 modules/nix/networking/default.nix create mode 100644 modules/nix/networking/openssh.nix diff --git a/modules/nix/default.nix b/modules/nix/default.nix index bc0ca4f..5ff484e 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -16,6 +16,7 @@ ./groups ./hardware ./ide + ./networking ./notif ./office ./rice diff --git a/modules/nix/networking/default.nix b/modules/nix/networking/default.nix new file mode 100644 index 0000000..29f07f6 --- /dev/null +++ b/modules/nix/networking/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./openssh.nix + ]; +} diff --git a/modules/nix/networking/openssh.nix b/modules/nix/networking/openssh.nix new file mode 100644 index 0000000..7e56ad4 --- /dev/null +++ b/modules/nix/networking/openssh.nix @@ -0,0 +1,25 @@ +{ lib, config, ... }: +let + inherit (lib) mkIf mkOption types; +in +{ + options.smayzy.openssh.enable = mkOption { + type = types.bool; + default = false; + description = "openssh"; + }; + + config = mkIf config.smayzy.openssh.enable { + services.openssh = { + enable = true; + ports = [ 22 ]; + settings = { + PasswordAuthentication = true; + AllowUsers = null; + UseDns = true; + X11Forwarding = false; + PermitRootLogin = "no"; + }; + }; + }; +}