hallettj, (edited )
@hallettj@leminal.space avatar

It’s possible (and I think advisable) to set your flake nixos config to set the system flake registry to point to the same nixpkgs revision that your flake uses. The nixos-starter-configs standard template has two lines that do this:


<span style="color:#323232;"># Opinionated: make flake registry and nix path match flake inputs
</span><span style="color:#323232;">registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
</span><span style="color:#323232;">nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
</span>

That actually adds all of your flake inputs to the system flake registry. So for example if in addition to your nixpkgs input you also have an input you named nixpkgs-unstable then can also reference that with stuff like nix shell. For example:


<span style="color:#323232;">nix shell nixpkgs#hello nixpkgs-unstable#cowsay
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • nix@programming.dev
  • khanakhh
  • DreamBathrooms
  • ethstaker
  • magazineikmin
  • osvaldo12
  • Durango
  • Youngstown
  • ngwrru68w68
  • slotface
  • rosin
  • mdbf
  • kavyap
  • InstantRegret
  • tester
  • JUstTest
  • thenastyranch
  • cisconetworking
  • tacticalgear
  • cubers
  • everett
  • modclub
  • GTA5RPClips
  • anitta
  • Leos
  • provamag3
  • normalnudes
  • megavids
  • lostlight
  • All magazines