Revert to hdiutil for older macos compatibility, be explicit about the weird number after ram://

This commit is contained in:
Nathan Henrie 2023-01-30 15:51:52 -07:00
parent 9779a98f1e
commit 6ec0b0f7c7
1 changed files with 2 additions and 1 deletions

View File

@ -23,7 +23,8 @@ with lib; let
if isDarwin
then ''
if ! diskutil info "${cfg.secretsMountPoint}" &> /dev/null; then
dev=$(diskutil image attach -mountPolicy=noMount ram://1MiB | sed 's/[[:space:]]*$//')
num_sectors=1048576
dev=$(hdiutil attach -nomount ram://"$num_sectors" | sed 's/[[:space:]]*$//')
newfs_hfs -v agenix "$dev"
mount -t hfs -o nobrowse,nodev,nosuid,-m=0751 "$dev" "${cfg.secretsMountPoint}"
fi