uvms/profiles/vsock-connect-guest.nix
Else, Someone 6d710952ee cloud-hypervisor sockets: use spectrum names
- CONNECT.sock → vsock.sock
- ch.sock → vmm.sock
2025-10-09 05:10:53 +03:00

30 lines
786 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=vsock.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; };
};
}
];
}