Skip to content

Commit 04cd269

Browse files
committed
nixos-modules/host/default: Create and chown sources of shares
1 parent 5103fad commit 04cd269

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

nixos-modules/host/default.nix

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,14 @@ in
9494
then updateFlake
9595
else flake}' > flake
9696
chown -h ${user}:${group} flake
97-
'';
97+
''
98+
# Make sure that the sources of the shares can be accessed.
99+
# Also ignore failures of each command for now
100+
+ builtins.foldl' (acc: share: acc + ''
101+
# Initialize permissions for share with mountPoint ${share.mountPoint}
102+
mkdir -p '${share.source}' || :
103+
chown -hR ${user}:${group} '${share.source}' || :
104+
'') "" guestConfig.microvm.shares;
98105
serviceConfig.SyslogIdentifier = "install-microvm-${name}";
99106
};
100107
"microvm@${name}" = {

0 commit comments

Comments
 (0)