diff --git a/nixos/virtual.nix b/nixos/virtual.nix index b623858..e1b7cab 100644 --- a/nixos/virtual.nix +++ b/nixos/virtual.nix @@ -42,14 +42,33 @@ config = { system.stateVersion = hypervisorConfig.system.stateVersion; - microvm = { - shares = [{ - source = "/nix/store"; - mountPoint = "/nix/.ro-store"; - tag = "ro-store"; - proto = "virtiofs"; + services.openssh = { + hostKeys = [{ + path = "/etc/ssh/host_keys/ssh_host_ed25519_key"; + type = "ed25519"; }]; + extraConfig = '' + HostKey /etc/ssh/host_keys/ssh_host_ed25519_key + ''; + }; + + microvm = { + shares = [ + { + source = "/nix/store"; + mountPoint = "/nix/.ro-store"; + tag = "ro-store"; + proto = "virtiofs"; + } + { + source = "/var/lib/microvms/${config.networking.hostName}/shares/host_keys"; + mountPoint = "/etc/ssh/host_keys"; + tag = "host_keys"; + proto = "virtiofs"; + } + ]; + interfaces = [{ type = "tap"; id = "vm-${config.networking.hostName}";