Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions lib/types/bcachefs_filesystem.nix
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,9 @@
SUBVOL_ABS_PATH="$MNTPOINT/${subvolume.name}";
# Check if it's already a subvolume (using snapshot).
if ! bcachefs subvolume snapshot "$SUBVOL_ABS_PATH" "$TEMPDIR/" >&2 2>&1; then
# It's not a subvolume, now check if it's a directory.
if ! test -d "$SUBVOL_ABS_PATH"; then
# It's not a subvolume AND not a directory, so create it.
mkdir -p -- "$(dirname -- "$SUBVOL_ABS_PATH")";
bcachefs subvolume create "$SUBVOL_ABS_PATH";
fi
# Attempt to create the subvolume otherwise.
mkdir -p -- "$(dirname -- "$SUBVOL_ABS_PATH")";
bcachefs subvolume create "$SUBVOL_ABS_PATH";
fi;
)
'') (lib.attrValues config.subvolumes)}
Expand Down
Loading