Installing only a single package from `unstable`

I have been doing it this way:

  1. Add the channel as root
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
sudo nix-channel --update
  1. Edit the nix file with your environment.systemPackages something like this:
let
  unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in {
  environment.systemPackages = with pkgs; [
    wget
    vim
    unstable.ffmpeg
  ];
}

It is covered in one of the docs but I can never find it when I need it.

16 Likes