How do I set the default channel in NixOS's /etc/configuration.nix
?
There is a command to set it and rebuild with
sudo nix-channel --add https://nixos.org/channels/nixpkgs-unstable
sudo nixos-rebuild switch -I nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixpkgs
but I'd like to have it setup in configuration.nix so I don't have to remember how to do this everytime. Thanks!
system.autoUpgrade.channel
is what you might be looking for
set it to any channel e.g.
system.autoUpgrade.channel = "https://nixos.org/channels/nixos-16.03-small/";
the documentation says:
by default, this is the channel set using nix-channel (run
nix-channel --list
to see the current value)
an up to date list of channels can be found on https://nixos.org/channels/
ref: https://nixos.org/nixos/manual/options.html#opt-system.autoUpgrade.channel https://nixos.org/nixos/manual/index.html#idm140737317454064
Set nixPath = [ "nixpkgs=http://nixos.org/channels/nixos-unstable/nixexprs.tar.xz" ];
, see https://github.com/snabblab/snabblab-nixos/blob/d8b9761b107293891b19021f2f0f77a0e3ba3746/modules/common.nix#L39
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With