Skip to content

Commit

Permalink
nixos-modules/microvm/mounts: add fix for hanging qemu shutdown
Browse files Browse the repository at this point in the history
Thanks to @thkoch2001 for debugging work ad for this suggestion.

Fixes Github issue #170
  • Loading branch information
astro committed Dec 20, 2023
1 parent 21d285d commit 736d43a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nixos-modules/microvm/mounts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,13 @@ lib.mkIf config.microvm.guest.enable {
};
};
};

# Fix for hanging shutdown
systemd.mounts = lib.mkIf config.boot.initrd.systemd.enable [ {
what = "store";
where = "/nix/store";
# Generate a `nix-store.mount.d/overrides.conf`
overrideStrategy = "asDropin";
unitConfig.DefaultDependencies = false;
} ];
}
1 change: 1 addition & 0 deletions nixos-modules/microvm/optimization.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ in
# TODO: error mounting /nix/store on crosvm, kvmtool
boot.initrd.systemd.enable = lib.mkDefault (
builtins.elem cfg.hypervisor [
"qemu"
"cloud-hypervisor"
"firecracker"
"stratovirt"
Expand Down

0 comments on commit 736d43a

Please sign in to comment.