diff options
author | Domen Kožar <domen@dev.si> | 2021-12-08 20:03:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-08 20:03:45 +0000 |
commit | 9b2ff20e3bdfbcc3d285b0ca621ebcc6cf968824 (patch) | |
tree | 546f68ef787451c696575be694ad9b27ba02e85b /scripts | |
parent | 167e864697ecfb7ce20faa02c01d000696d3d425 (diff) | |
parent | b6d08a9e3ff76a38636377abe383b179b38e37b5 (diff) |
Merge pull request #5489 from abathur/fix_macos_install_vim_plugins
darwin-install: fix break from bad vim plugins
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/create-darwin-volume.sh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/create-darwin-volume.sh b/scripts/create-darwin-volume.sh index 334b75045..bd8a7ee3a 100755 --- a/scripts/create-darwin-volume.sh +++ b/scripts/create-darwin-volume.sh @@ -440,7 +440,22 @@ add_nix_vol_fstab_line() { # shellcheck disable=SC1003,SC2026 local escaped_mountpoint="${NIX_ROOT/ /'\\\'040}" shift - EDITOR="/usr/bin/ex" _sudo "to add nix to fstab" "$@" <<EOF + + # wrap `ex` to work around a problem with vim plugins breaking exit codes; + # (see https://github.com/NixOS/nix/issues/5468) + # we'd prefer EDITOR="/usr/bin/ex --noplugin" but vifs doesn't word-split + # the EDITOR env. + # + # TODO: at some point we should switch to `--clean`, but it wasn't added + # until https://github.com/vim/vim/releases/tag/v8.0.1554 while the macOS + # minver 10.12.6 seems to have released with vim 7.4 + cat > "$SCRATCH/ex_cleanroom_wrapper" <<EOF +#!/bin/sh +/usr/bin/ex --noplugin "\$@" +EOF + chmod 755 "$SCRATCH/ex_cleanroom_wrapper" + + EDITOR="$SCRATCH/ex_cleanroom_wrapper" _sudo "to add nix to fstab" "$@" <<EOF :a UUID=$uuid $escaped_mountpoint apfs rw,noauto,nobrowse,suid,owners . @@ -631,7 +646,7 @@ EOF # technically /etc/synthetic.d/nix is supported in Big Sur+ # but handling both takes even more code... _sudo "to add Nix to /etc/synthetic.conf" \ - /usr/bin/ex /etc/synthetic.conf <<EOF + /usr/bin/ex --noplugin /etc/synthetic.conf <<EOF :a ${NIX_ROOT:1} . @@ -794,7 +809,7 @@ setup_volume_daemon() { local volume_uuid="$2" if ! test_voldaemon; then task "Configuring LaunchDaemon to mount '$NIX_VOLUME_LABEL'" >&2 - _sudo "to install the Nix volume mounter" /usr/bin/ex "$NIX_VOLUME_MOUNTD_DEST" <<EOF + _sudo "to install the Nix volume mounter" /usr/bin/ex --noplugin "$NIX_VOLUME_MOUNTD_DEST" <<EOF :a $(generate_mount_daemon "$cmd_type" "$volume_uuid") . |