nix-configs/nixos-modules/services/ssh.nix
Philipp Hochkamp efb65de325 feat: icarus
2022-11-17 10:12:51 +01:00

14 lines
447 B
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.ragon.services.ssh;
pubkeys = import ../../data/pubkeys.nix;
in
{
options.ragon.services.ssh.enable = lib.mkEnableOption "Enables sshd";
config = lib.mkIf cfg.enable {
services.openssh.permitRootLogin = "without-password";
services.openssh.enable = true;
services.openssh.passwordAuthentication = false;
users.users.root.openssh.authorizedKeys.keys = pubkeys.ragon.user;
};
}