summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sys/auth/openssh.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/auth/openssh.nix b/sys/auth/openssh.nix
index ca32979..07e6977 100644
--- a/sys/auth/openssh.nix
+++ b/sys/auth/openssh.nix
@@ -144,10 +144,16 @@ in
};
systemd.sockets = mkIf (restrict != null && restrict.vsockCid != null) {
- sshd = {
- after = [ "nixvirt.service" ];
- socketConfig.ListenStream = mkForce [ "vsock:${toString restrict.vsockCid}:${toString port}" ];
- };
+ sshd =
+ let
+ kernelMod = "modprobe@${if restrict.vsockCid == 2 then "vhost_" else ""}vsock.service";
+ in
+ {
+ after = [ kernelMod ];
+ wants = [ kernelMod ];
+
+ socketConfig.ListenStream = mkForce [ "vsock:${toString restrict.vsockCid}:${toString port}" ];
+ };
};
users.users = {