Nix profile install nixpkgs#google-chrome

A first installtion of google-chrome:

nix profile install nixpkgs#google-chrome

Although Unfree is true in /etc/nixos/configuration.nix , the installation fails with that error.

Setting nixpkgs.config.allowUnfree = true; in your config does not impact packages outside of your config, unfortunately.

You would have to do something like

 env NIXPKGS_ALLOW_UNFREE=1 nix run nixpkgs#google-chrome --impure

Or, set the contents of ~/.config/nixpkgs/config.nix to something like

{
  allowUnfree = true;
}

And use

nix run nixpkgs#google-chrome --impure
1 Like

However, after successful install, I do not seem to start it next time (missing icon).

What desktop env do you use?

Gnome is the desktop env.

and google-chrome says “command not found”; apologies for my ignorance.

That’s because nix run doesn’t actually install the package like nix profile install would, though it is still built in /nix/store/.

So, assuming you continue with this approach, you’ll have to be re-running the same nix install command every time you want to use Google Chrome. Fortunately, you don’t have to rebuild it every time, unless you remove it or it gets updated, I guess.

1 Like

Appreciate. If I run:

nix profile install nixpkgs#google-chrome --impure

then which does not find google-chrome. Any ideas?

The binary is called google-chrome-stable.

2 Likes

I am there. Thanks to all for your swift responses!