also refactor nixos modules
This commit is contained in:
parent
2471562583
commit
b37c5c0cbd
44 changed files with 10 additions and 2 deletions
30
modules/nixos/services/networking/ssh.nix
Normal file
30
modules/nixos/services/networking/ssh.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
|
||||
cfg = config.sneeuwvlok.services.networking.ssh;
|
||||
in {
|
||||
options.sneeuwvlok.services.networking.ssh = {
|
||||
enable = mkEnableOption "enable ssh";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
ports = [22];
|
||||
settings = {
|
||||
PasswordAuthentication = true;
|
||||
AllowUsers = ["chris" "root"];
|
||||
UseDns = true;
|
||||
UsePAM = true;
|
||||
PermitRootLogin = "prohibit-password";
|
||||
PermitEmptyPasswords = "no";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue