14 lines
516 B
Nix
14 lines
516 B
Nix
|
{ pkgs, sys, ... }: {
|
||
|
# Enable SSH server with exclusively key-based auth
|
||
|
services.openssh = {
|
||
|
enable = true;
|
||
|
settings.PasswordAuthentication = false;
|
||
|
settings.KbdInteractiveAuthentication = false;
|
||
|
};
|
||
|
users.users."${sys.username}".openssh.authorizedKeys.keys = let
|
||
|
authorizedKeys = pkgs.fetchurl {
|
||
|
url = "https://github.com/Jafner.keys";
|
||
|
sha256 = "1i3Vs6mPPl965g3sRmbXGzx6zQBs5geBCgNx2zfpjF4=";
|
||
|
};
|
||
|
in pkgs.lib.splitString "\n" (builtins.readFile authorizedKeys);
|
||
|
}
|