NixOS: Channels basics
Solution
Upgrading NixOS/changing channels
Note: sudo is usually needed for NixOS installations in the commands below. Check if the first command returns a valid url without using sudo. If yes, you probably don't have to/shouldn't use sudo from the following commands!
# View current NixOS channel
sudo nix-channel --list | grep nixos
# Set new NixOS channel/upgrade NixOS
sudo nix-channel --add https://channels.nixos.org/nixos-25.11 nixos
# Rebuild with --upgrade, set on boot to be thorough
sudo nixos-rebuild boot --upgrade
# Reboot the system
sudo reboot now
You can view the latest stable channel from the manual link below or checking the channel options in search.nixos.org!
Using packages from other channels
{ config, pkgs, ... }:
let
unstable = import (builtins.fetchTarball
"https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"
) {
config.allowUnfree = true;
};
in
{
# Method 1: singular package from another channel
environment.systemPackages = with pkgs; [
alacritty # Default channel
unstable.hyprlock # From unstable
] ++ (with unstable; [
# Method 2: Multiple packages from another channel
stremio-linux-shell
discord
]);
}