diff options
| author | Michael Hoang <enzime@users.noreply.github.com> | 2024-11-05 00:54:34 +1100 |
|---|---|---|
| committer | Michael Hoang <enzime@users.noreply.github.com> | 2024-11-07 18:17:34 +1100 |
| commit | 84ad3a2d7ea74cabd7f71261ca4a191585d47beb (patch) | |
| tree | b4d40d88eb0423afa1ea52aa445f5a11707c1932 /pkgs | |
| parent | 158198a6e3690facf15718b24571789c0756d43a (diff) | |
uninstaller: remove `/run` symlink
Diffstat (limited to 'pkgs')
| -rw-r--r-- | pkgs/darwin-uninstaller/default.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/darwin-uninstaller/default.nix b/pkgs/darwin-uninstaller/default.nix index 3eb2c24..a82974e 100644 --- a/pkgs/darwin-uninstaller/default.nix +++ b/pkgs/darwin-uninstaller/default.nix @@ -63,10 +63,21 @@ stdenv.mkDerivation { ${uninstallSystem.system}/sw/bin/darwin-rebuild activate - if test -L /run/current-system; then + if [[ -L /run/current-system ]]; then sudo rm /run/current-system fi + if [[ -L /run ]]; then + if [[ -e /etc/synthetic.conf ]]; then + sudo sed -i -E '/^run[[:space:]]/d' /etc/synthetic.conf + sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -B &>/dev/null || true + sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t &>/dev/null || true + echo >&2 "NOTE: the /run symlink will be removed on reboot" + else + sudo rm /run + fi + fi + echo >&2 echo >&2 "NOTE: The /nix/var/nix/profiles/system* profiles still exist and won't be garbage collected." echo >&2 |
