If you'd like to keep up-to-date with Chrome from unstable but otherwise want to run a stable NixOS release you can do the following:
- Create a file
/etc/nixos/unstable.nix
:
{ config, pkgs, ...}:
let
baseconfig = { allowUnfree = true; };
unstable = import <nixos-unstable> { config = baseconfig; };
in {
environment.systemPackages = with pkgs; [
unstable.google-chrome
];
}
- Modify
/etc/nixos/configuration.nix
:
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./unstable.nix
];
- Subscribe
root
to unstable:
sudo nix-channel --add https://nixos.org/channels/nixpkgs-unstable
sudo nix-channel --update
- Ensure you have done everything correctly and then rebuild and switch:
sudo nixos-rebuild dry-build
sudo nixos-rebuild switch --upgrade
Log out and back in again
I had installed Chrome imperatively, which is used in preference. See if you have done this via:
nix-env -q
# remove with nix-env --uninstall
Thank you for this!