30 lines
788 B
Nix
30 lines
788 B
Nix
{
|
|
options,
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
mkIfGuest = import ../lib/mkIfMicrovmGuest.nix { inherit options config lib; };
|
|
in
|
|
{
|
|
config = lib.mkMerge [
|
|
(mkIfGuest {
|
|
microvm.cloud-hypervisor.extraArgs = [
|
|
"--vsock"
|
|
"cid=4,socket=CONNECT.sock"
|
|
];
|
|
})
|
|
{
|
|
# Somehow, sshd calls to PAM with PAM_RHOST="UNKNOWN",
|
|
# prompting a slow DNS look-up each time...
|
|
#
|
|
# https://mastodon.acm.org/@nobody/115108458851355328
|
|
# https://github.com/linux-pam/linux-pam/issues/885#issuecomment-3030698895
|
|
networking.hosts."100::" = [ "UNKNOWN" ];
|
|
boot.initrd.extraFiles = lib.optionalAttrs config.boot.initrd.network.ssh.enable {
|
|
"/etc/hosts" = { inherit (config.environment.etc.hosts) source; };
|
|
};
|
|
}
|
|
];
|
|
}
|