]> git.scottworley.com Git - nix-profile-gc/blobdiff - modules/profile-gc.nix
Fix profile comparison: Don't use full path where name is expected
[nix-profile-gc] / modules / profile-gc.nix
index 5444798568249e38724cb965ea3068d0747d2afd..3a2e44a153975ea26ddf605a3a7a90e0fc7253d4 100644 (file)
@@ -179,7 +179,8 @@ in {
             echo "(Disregarding unrelated profile $p)" >&2
             continue
           fi
-          if [[ "$p" == "$current" ]];then
+          pname=$(${pkgs.coreutils}/bin/basename "$p")
+          if [[ "$pname" == "$current" ]];then
             echo "Keeeping current profile $p" >&2
             continue
           fi
@@ -187,7 +188,7 @@ in {
             echo "Keeeping active system/boot profile $p" >&2
             continue
           fi
-          if [[ "''${active[$p]:-}" ]];then
+          if [[ "''${active[$pname]:-}" ]];then
             echo "Keeeping active profile $p" >&2
             continue
           fi