disko-install: resolve symlinks in mount point path

Nix refuses to operate when the store path or its parent directories
contain symlinks. On some systems /mnt can be a symlink, causing
disko-install to fail with:

  error: the path '"/mnt"' is a symlink; this is not allowed for the
  Nix store and its parent directories

Use realpath to resolve symlinks before passing the mount point to
nix-store and nixos-install commands.
This commit is contained in:
Jörg Thalheim committed 2025-12-18 16:42:05 +01:00
1 parent 7194cfe5b7
commit 3be6dfbaca
2 files changed
+11 -5

No files matched your search

+3
View File
@@ -224,6 +224,9 @@ main() {
maybeRun mkdir -p "${mountPoint}"
maybeRun chmod 755 "${mountPoint}" # bcachefs wants 755
# Resolve symlinks in mountPoint path to satisfy nix-store requirements
# (nix refuses symlinks in store path hierarchy)
mountPoint=$(realpath "${mountPoint}")
# shellcheck disable=SC2064
if [[ -z ${dry_run-} ]]; then
trap cleanupMountPoint EXIT