{ config, lib, pkgs, ... }: with lib; { options.profiles.clerie.common-ssh = { enable = mkEnableOption "Common ssh config"; }; config = mkIf config.profiles.clerie.common-ssh.enable { services.openssh.enable = true; services.openssh.settings = { PasswordAuthentication = false; KbdInteractiveAuthentication = false; PermitRootLogin = lib.mkDefault "no"; }; services.openssh.hostKeys = lib.mkForce [ # Only create ed25519 host keys { type = "ed25519"; path = "/etc/ssh/ssh_host_ed25519_key"; } ]; programs.ssh.knownHostsFiles = [ (pkgs.clerie-ssh-known-hosts + "/known_hosts") (pkgs.well-known-ssh-known-hosts + "/known_hosts") ]; }; }