diff --git a/nixos-modules/host/default.nix b/nixos-modules/host/default.nix index 56bb289f..1e07a928 100644 --- a/nixos-modules/host/default.nix +++ b/nixos-modules/host/default.nix @@ -94,7 +94,15 @@ in then updateFlake else flake}' > flake chown -h ${user}:${group} flake - ''; + '' + # Make sure that the sources of the shares can be accessed. + # Also ignore failures of each command for now + + builtins.foldl' (acc: share: + acc + lib.optionalString (share.source != "/nix/store") '' + # Initialize permissions for share with mountPoint ${share.mountPoint} + mkdir -p '${share.source}' || : + chown -hR ${user}:${group} '${share.source}' || : + '') "" guestConfig.microvm.shares; serviceConfig.SyslogIdentifier = "install-microvm-${name}"; }; "microvm@${name}" = {