diff --git a/nixos-modules/host/default.nix b/nixos-modules/host/default.nix index fea96b23..3a7049a3 100644 --- a/nixos-modules/host/default.nix +++ b/nixos-modules/host/default.nix @@ -92,7 +92,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}" = {