tadpole: Add ssh module
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
@@ -33,8 +33,6 @@
|
||||
vim
|
||||
];
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
config-manager = {
|
||||
flakePath = "/home/alex/config";
|
||||
};
|
||||
|
||||
@@ -7,6 +7,8 @@ in
|
||||
imports = lib.mapAttrsToList toModulePath (filterDirs (builtins.readDir ./.));
|
||||
|
||||
config = {
|
||||
mod = {};
|
||||
mod = {
|
||||
ssh.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
37
hosts/tadpole/modules/ssh/default.nix
Normal file
37
hosts/tadpole/modules/ssh/default.nix
Normal 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 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user