flake: put nixpkgs in NIX_PATH and system registry for flake configs

Currently there are a bunch of really wacky hacks required to get
nixpkgs path correctly set up under flake configs such that `nix run
nixpkgs#hello` and `nix run -f '<nixpkgs>' hello` hit the nixpkgs that
the system was built with. In particular you have to use specialArgs or
an anonymous module, and everyone has to include this hack in their own
configs.

We can do this for users automatically.

NixOS/nixpkgs@e456032add

Co-authored-by: Antoine Cotten <hello@acotten.com>
This commit is contained in:
Jade Lovelace 2024-09-10 22:37:18 +02:00 committed by Antoine Cotten
parent f4f18f3d72
commit 8714f9e285
No known key found for this signature in database
3 changed files with 107 additions and 0 deletions

View file

@ -47,6 +47,7 @@
./nix/linux-builder.nix
./nix/nix-darwin.nix
./nix/nixpkgs.nix
./nix/nixpkgs-flake.nix
./environment
./fonts
./launchd