tadpole: Add ssh module

This commit is contained in:
Alexander Heldt
2024-07-20 20:12:23 +02:00
parent 51597caaf5
commit 4967e846a8
3 changed files with 41 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { pkgs, ... }:
{ {
imports = imports =
@@ -33,8 +33,6 @@
vim 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,37 @@
{ 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 ];
hostKeys = [{
path = "/etc/ssh/tadpole";
type = "ed25519";
}];
};
};
networking = {
firewall = {
allowedTCPPorts = [ 1122 ];
};
};
};
}