Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I select GCC version in nix-shell?

Tags:

nixos

I am requesting GCC 8, but I get GCC 7 instead.

$ nix-shell -p gcc8
[nix-shell:~]$ gcc --version
gcc (GCC) 7.3.0

What is going on?

like image 903
user7610 Avatar asked May 10 '18 16:05

user7610


1 Answers

Use nix run instead. It behaves better, and also has nicer progress indicator when downloading packages.

jdanek@nixos ~ % nix run -f channel:nixos-19.03 gcc8
[jdanek@nixos:~]$ gcc --version
gcc (GCC) 8.3.0
like image 53
user7610 Avatar answered Oct 07 '22 07:10

user7610