mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-24 12:18:46 +08:00
28 lines
704 B
Nix
28 lines
704 B
Nix
|
inputs:
|
||
|
{
|
||
|
options.nixos.services.sshd = let inherit (inputs.lib) mkOption types; in
|
||
|
{
|
||
|
enable = mkOption { type = types.bool; default = false; };
|
||
|
passwordAuthentication = mkOption { type = types.bool; default = false; };
|
||
|
};
|
||
|
config =
|
||
|
let
|
||
|
inherit (inputs.lib) mkIf;
|
||
|
inherit (inputs.config.nixos.services) sshd;
|
||
|
in mkIf sshd.enable
|
||
|
{
|
||
|
services.openssh =
|
||
|
{
|
||
|
enable = true;
|
||
|
settings =
|
||
|
{
|
||
|
X11Forwarding = true;
|
||
|
ChallengeResponseAuthentication = false;
|
||
|
PasswordAuthentication = sshd.passwordAuthentication;
|
||
|
KbdInteractiveAuthentication = false;
|
||
|
UsePAM = true;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|