mirror of
https://github.com/librephoenix/nixos-config
synced 2025-10-19 10:04:03 +05:30
Major config overhaul: use custom modules, setup for multi-host config, and less boilerplate
This commit is contained in:
parent
1fa8b17b07
commit
0453901d17
303 changed files with 3560 additions and 5566 deletions
25
modules/system/security/sshd/default.nix
Normal file
25
modules/system/security/sshd/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.systemSettings.security.sshd;
|
||||
in {
|
||||
options = {
|
||||
systemSettings.security.sshd = {
|
||||
enable = lib.mkEnableOption "Enable incoming ssh connections";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Enable incoming ssh
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
PermitRootLogin = "no";
|
||||
};
|
||||
};
|
||||
# Don't forget to set:
|
||||
# users.users.${username}.openssh.authorizedKeys.keys = "myAuthorizedKey";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue