Show HN: Globset for Nix Source Filtering

github.com

6 points by hinshun 2 days ago

Hi there! I am Edgar and I wanted to share with you “globset”, a Nix library to help specify what sources to include when building a Nix package using familiar glob patterns like “*/*.go”.

Nix is package manager and meta build system, in that you glue together compilers and other build systems in repeatable sandboxes like “docker build”. When specifying the source inputs to a Nix package, you typically end up with irrelevant files that when changed causes a rebuild unnecessarily.

“globset” provides a concise and simple way of specifying what sources should be included. It is built on top of the new “fileset” library introduced in Nixpkgs 23.11, and is composable with any libraries using it. This is our second open source project after releasing nix-snapshotter last year. (See: https://news.ycombinator.com/item?id=37407758)