Skip to content

Commit e8bfac9

Browse files
committed
nixos-modules/host/default: Create and chown sources of shares
1 parent c9fe9b9 commit e8bfac9

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
@@ -92,7 +92,14 @@ in
9292
then updateFlake
9393
else flake}' > flake
9494
chown -h ${user}:${group} flake
95-
'';
95+
''
96+
# Make sure that the sources of the shares can be accessed.
97+
# Also ignore failures of each command for now
98+
+ builtins.foldl' (acc: share: acc + ''
99+
# Initialize permissions for share with mountPoint ${share.mountPoint}
100+
mkdir -p '${share.source}' || :
101+
chown -hR ${user}:${group} '${share.source}' || :
102+
'') "" guestConfig.microvm.shares;
96103
serviceConfig.SyslogIdentifier = "install-microvm-${name}";
97104
};
98105
"microvm@${name}" = {

0 commit comments

Comments
 (0)