One of the killer features of flakes is Flakerefs which allow to directly refer to a – potentially remote – Nix expression from the command-line very concisely (nix run nixpkgs#hello).
Most of that is however not flake-specific, but just pertains to the fetchers infrastructure which gives this URL-ish syntax for accessing remote resources[^1].
We can easily bring that to old-style Nix expressions with a new CLI syntax --tree <treeRef>#attr.path that would be morally equivalent to --file $(nix flake prefetch <treeRef>) attr.path.
We can then remove the NIX_PATH=flake:<flakeref> hack as it won't be needed any more (removing it is OK because although it's exposed to the old CLI, it depends on Flakes to be enabled).
[^1]: There is actually a hack that allows having flake:<flakeref> in NIX_PATH to fetch a remote fetcher ref from the network without really using flakes
One of the killer features of flakes is Flakerefs which allow to directly refer to a – potentially remote – Nix expression from the command-line very concisely (
nix run nixpkgs#hello
). Most of that is however not flake-specific, but just pertains to the fetchers infrastructure which gives this URL-ish syntax for accessing remote resources[^1]. We can easily bring that to old-style Nix expressions with a new CLI syntax--tree <treeRef>#attr.path
that would be morally equivalent to--file $(nix flake prefetch <treeRef>) attr.path
.We can then remove the
NIX_PATH=flake:<flakeref>
hack as it won't be needed any more (removing it is OK because although it's exposed to the old CLI, it depends on Flakes to be enabled).[^1]: There is actually a hack that allows having
flake:<flakeref>
inNIX_PATH
to fetch a remote fetcher ref from the network without really using flakes