In nix flake, how to track nixos-unstable?

I saw someone mentioning nixFlakes on IRC and thought I would try it out even though I had otherwise limited interest.
So here I am trying to install packages from nixos-unstable but don’t know how.

$ nix run nixpkgs:ghc works fine since it appears in GitHub - NixOS/flake-registry: Global registry of Nix flakes and nix flake list.
$ nix run nixos-unstable:ghc won’t work. I thought of adding nixos-unstable but it doesn’t contain a flake.nix (I just read through nix-flakes.md · GitHub).

How can I use nixos-unstable then (if that’s already possible)

You can’t at the moment. The nixpkgs flake is actually a temporary fork of NixOS/nixpkgs that contains a flake.nix file, which the upstream repo doesn’t have yet.

1 Like

just to mention I am now able to use a local checkout of nixos-unstable via nix flake add mine /home/teto/nixpkgs

Looks great. Is it possible to use that flake for a nixos-rebuild?

just as an update, the previous doesn’t work anymore, you should use

nix registry add nixpkgs ~/my-nixpkgs

as per Nix Flakes, Part 1: An introduction and tutorial