From c69689da5885f2405abe3947dfe73b687f04da6d Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Mon, 30 Jan 2023 14:21:33 -0700 Subject: [PATCH] Use diskutil for more convenient sizes, strip trailing tabs --- modules/age.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/age.nix b/modules/age.nix index 90637ad..ecdd8ee 100644 --- a/modules/age.nix +++ b/modules/age.nix @@ -23,7 +23,9 @@ with lib; let if isDarwin then '' if ! diskutil info "${cfg.secretsMountPoint}" &> /dev/null; then - dev=$(hdiutil attach -nomount ram://1MiB) + dev=$(diskutil image attach -mountPolicy=noMount ram://1MiB) + # Remove trailing tabs + dev=''${dev%%[[:space:]]*} newfs_hfs -v agenix "$dev" mount -t hfs -o nobrowse,nodev,nosuid,-m=0751 "$dev" "${cfg.secretsMountPoint}" fi