How to deactivate a NixOS component in OSX?

0

I have trouble using gcc in OSX.

I want to the gcc that comes with XCode (Apple LLVM version 10.0.1 (clang-1001.0.46.4)). However on my PATH this gcc (gcc (GCC) 7.4.0) is taken precedent.

$ which gcc
/Users/antkong/.nix-profile/bin/gcc

Is there anyway I can turn off/deactivate this particular package? I have checked the documentation but the main commands such as nix-env, nix-store etc do not offer any escape hatch.

I tried the following

$ nix-env -u gcc
warning: name collision in input Nix expressions, skipping '/Users/antkong/.nix-defexpr/channels_root/nixpkgs'

but gcc still points to the one under my nix profile.

Anthony Kong

Posted 2019-05-15T01:42:25.243

Reputation: 3 117

Answers

0

The command to use is actually

 nix-env -e gcc 

-u is not uninstall as I thought... It actually means upgrade.

Anthony Kong

Posted 2019-05-15T01:42:25.243

Reputation: 3 117