aboutsummaryrefslogtreecommitdiff
path: root/modules/nixos/services/ssh/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos/services/ssh/default.nix')
-rw-r--r--modules/nixos/services/ssh/default.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/nixos/services/ssh/default.nix b/modules/nixos/services/ssh/default.nix
new file mode 100644
index 0000000..6856897
--- /dev/null
+++ b/modules/nixos/services/ssh/default.nix
@@ -0,0 +1,28 @@
+{ options, config, lib, namespace, ... }:
+
+with lib; with lib.${namespace}; let
+ cfg = config.${namespace}.services.ssh;
+ impermanence = config.${namespace}.system.impermanence;
+in {
+ options.${namespace}.services.ssh = with types; {
+ enable = mkEnableOption "ssh server";
+
+ port = mkOption {
+ type = types.port;
+ default = 22;
+ description = "ssh server port";
+ };
+ };
+
+ config = mkIf cfg.enable {
+ openssh = {
+ enable = true;
+ ports = [ cfg.port ];
+
+ settings = {
+ PermitRootLogin = "no";
+ PasswordAuthentication = false;
+ };
+ };
+ };
+}