From cbe60343ad37f626dbefc8558581df802d6d2b79 Mon Sep 17 00:00:00 2001 From: "Andrew R. M" Date: Fri, 4 Apr 2025 17:43:05 +0000 Subject: [PATCH] Update removal for newer nix profile output --- installers/install-nix-packages-flake.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/installers/install-nix-packages-flake.sh b/installers/install-nix-packages-flake.sh index b134747..65a3b15 100755 --- a/installers/install-nix-packages-flake.sh +++ b/installers/install-nix-packages-flake.sh @@ -112,7 +112,9 @@ install_nix_packages() # The name of the package we are going to install, needed to check for presence/uninstall package_name=packages.x86_64-linux.myPackageCollection if [ "${nix_packages[*]}" ]; then - if nix profile list | cut -d' ' -f 2 | grep -q "${package_name}"; then + # Updated to process new nix profile format, proper processing probably needs JQ + # But JQ would be another dependency and this is good enough for now + if nix profile list --json | grep -i "\"attrPath\":\"${package_name}\""; then echo "Removing previous version of profile" nix profile remove "${package_name}" fi