backwards: Add ssh module

This commit is contained in:
Alexander Heldt
2024-08-15 14:42:17 +02:00
parent 3651fa4146
commit 60ab66b11c
3 changed files with 35 additions and 3 deletions

View File

@@ -78,8 +78,6 @@
pkgs.vim pkgs.vim
]; ];
services.openssh.enable = true;
config-manager = { config-manager = {
flakePath = "/home/alex/config"; flakePath = "/home/alex/config";
}; };

View File

@@ -7,6 +7,8 @@ in
imports = lib.mapAttrsToList toModulePath (filterDirs (builtins.readDir ./.)); imports = lib.mapAttrsToList toModulePath (filterDirs (builtins.readDir ./.));
config = { config = {
mod = {}; mod = {
ssh.enable = true;
};
}; };
} }

View File

@@ -0,0 +1,32 @@
{ lib, config, ... }:
let
enabled = config.mod.ssh.enable;
in
{
options = {
mod.ssh = {
enable = lib.mkEnableOption "enable ssh module";
};
};
config = lib.mkIf enabled {
home-manager.users.alex = {
programs.ssh = {
enable = true;
};
};
services = {
openssh = {
enable = true;
ports = [ 1122 ];
};
};
networking = {
firewall = {
allowedTCPPorts = [ 1122 ];
};
};
};
}