mirror of
https://codeberg.org/jopejoe1/nix-conf.git
synced 2025-01-07 21:26:51 +01:00
28 lines
613 B
Nix
28 lines
613 B
Nix
{ options, config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
#with lib.internal;
|
|
let cfg = config.custom.system.ssh;
|
|
in
|
|
{
|
|
options.custom.system.ssh = with types; {
|
|
enable = mkBoolOpt false "Whether or not to enable ssh.";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.openssh = {
|
|
enable = true;
|
|
ports = [ 22 ];
|
|
openFirewall = true;
|
|
allowSFTP = true;
|
|
settings = {
|
|
X11forwarding = true;
|
|
PermitRootLogin = "no";
|
|
passwordAuthentication = true;
|
|
kbdInteractiveAuthentication = true;
|
|
};
|
|
};
|
|
environment.systemPackages = with pkgs; [ sshfs ];
|
|
};
|
|
}
|
|
|