2

How can I install google chrome in nixos? I have tried

nix-env -i google-chrome
nix-env -i google-chrome-stable
...

Which does not seem to work. I also tried using the unstable branch

nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update

and then

nix-env -i unstable.google-chrome-stable
nix-env -i unstable.google-chrome
...

However it looks like the package should exist somewhere. https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/browsers/google-chrome

Does anybody know what I am missing here?

  • What do you mean by "Which does not seem to work?" – Emmanuel Rosa Mar 13 '18 at 1:56
  • The packages are not found – Arwed Mett Mar 13 '18 at 17:11
  • Have you tried nix-env -i nixos.google-chrome? – Emmanuel Rosa Mar 13 '18 at 18:57
  • just tried it. it also does not work – Arwed Mett Mar 14 '18 at 10:57
3

This NixOS FAQ question helped me:

How can I install a proprietary or unfree package?

You won't be able to install or search for an unfree package as a user, unless you explicitly enable it in ~/.config/nixpkgs/config.nix (the file and folder may need to be created):

{   # [...]   allowUnfree =
true; } 

When using NixOS, it is possible to enable unfree packages system-wide, then set in your /etc/nixos/configuration.nix:

{   # [...]   nixpkgs.config.allowUnfree = true; } 

Note that this alone will not allow you to search for or install packages with nix-env.

For temporary allowing unfree packages you can set the environment variable NIXPKGS_ALLOW_UNFREE, e.g.

NIXPKGS_ALLOW_UNFREE=1 nix-env 

Note that we are not able to test or build unfree software on Hydra due to policy. Most unfree licenses prohibit us from either executing or distributing the software.

From the console with nix-env:

$ NIXPKGS_ALLOW_UNFREE=1 nix-env -qa | grep google-chrome
google-chrome-63.0.3239.132
google-chrome-beta-64.0.3282.71
google-chrome-dev-65.0.3311.3

"Chapter 6. Global configuration" of the NixPkgs manual goes even deeper into the details (especially section 6.3. Installing unfree packages).

I found the rehno-lindeque/NixSetup.md gist exremely helpful with tons of extra resources and comments.

0

Basically, you need to check channel name first:

$ nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable

Once you know the channel name, in this case nixpkgs, then you can proceed to installation:

$ nix-env -iA nixpkgs.google-chrome
installing ‘google-chrome-64.0.3282.186’
..................

Alternatively, you can search fully qualified name before perform the installation:

$ nix-env -qaP google-chrome                                                                                                                               
nixpkgs.google-chrome  google-chrome-64.0.3282.186

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.