Angle brackets in a Nix flake world

https://news.ycombinator.com/rss Hits: 4
Summary

At DEFCON33, the Nix community had its first-ever presence via nix.vegas and I ended up in fun conversation with tomberek πŸ™Œ. β€œWhat fun things can we do with < and > with the eventual deprecation of NIX_PATH? The actual πŸ’‘ was from tomberek and this is a demonstration of what that might look like without necessitating any changes to CppNix itself. As a very worthwhile aside, the first time presence of the Nix community at DEFCON was fantastic and I am extra appreciative to numinit and RossComputerguy πŸ™‡. The badges handed out were so cool. They have strobing LEDs but also can act as a substituter for the Nix infra that was setup. Okay, back to the idea πŸ’. Importing nixpks via the NIX_PATH through the angle-bracket syntax has been a long-standing wart on the reproducibility promises of Nix. let pkgs = import <nixpkgs> {}; in pkgs.hello There is a really great article about all the problems with this approach to bringing in projects on nix.dev, for those whom are still leveraging it. With the eventual planned removal of support for NIX_PATH, we are now presented with an opportunity of some new functionality in Nix, namely the angled brackets <something> that can be reconstituted for a new purpose. Looks like others are already starting to think about this idea. The project htmnix demonstrates the functionality of writing pure-HTML but evaluating it with nix eval πŸ˜‚. For something potentially more immediately useful, how about giving quicker access to the attributes of the current flake? πŸ€” A common pattern that has emerged is to inject inputs and outputs into extraSpecialArgs so that they are available to modules in NixOS or home-manager. { homeConfigurations = { "alice" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages."aarch64-darwin"; extraSpecialArgs = {inherit inputs outputs;}; modules = [ ./users/alice ]; }; } This lets you add the modules from your inputs or reference the packages in your outputs from within the modules themselves. { inputs...

First seen: 2025-08-14 00:08

Last seen: 2025-08-14 03:10