I’ve been meaning to figure out how to make nix run use the system flake’s version to speed things up a bit, so seeing this posted here yesterday was a nice surprise! However, I had some trouble getting things to work. At first I tried to add this to the modules list of my system flake:
({ config, lib, ... }: { nix.registry = lib.attrsets.removeAttrs inputs [ "self" ]; })
(Aside: I don’t know if this is a problem with my system, but I had to use lib.attrsets.removeAttrs or builtins.removeAttrs instead of lib.removeAttrs which didn’t seem to exist. Maybe a difference between stable and unstable?)
The code above resulted in an error:
error: The option `nix.registry.agenix._type' does not exist. Definition values:
- In `/nix/store/3s69yxbbl116zwga3i6cy7prplywq0bn-source/flake.nix': "flake"
I simplified the case down to
{ nix.registry.nixpkgs = nixpkgs; }
to avoid dealing with other inputs and any attribute set manipulation issues at first. It caused a similar error, though. After some googling, I ended up trying
{ nix.registry.nixpkgs.flake = nixpkgs; }
which worked. (Note the .flake
in the attribute path.) Consulting documentation for nix.registry talks about nix.registry.<name>.flake
too.
While I was writing this message, I took another look at the more advanced example near the end of the post. I had to do some repl checking to understand it better, but it seems like the inherit flake
part handles the last part of the attribute path there? I’m not too experienced with Nix/NixOS yet, but is it possible the earlier code examples are just missing the .flake
or is there something weird going on with my system?
Also, FWIW, the images and the video clip worked for me, on Firefox for macOS and Linux.