Nix library for filtering local source directories using gitignore rules, enabling reproducible builds.
gitignore.nix is a Nix library that provides functions to filter local source directories by applying gitignore rules. It solves the problem of including local git repositories in Nix builds while respecting ignore patterns, ensuring only relevant files are copied to the Nix store for reproducible builds.
Nix developers and DevOps engineers who need to incorporate local source code into Nix expressions while maintaining gitignore compliance and build reproducibility.
Developers choose gitignore.nix for its accurate gitignore emulation, performance optimizations, and seamless integration with Nix's functional model, offering a more reliable alternative to basic Nix source filtering functions.
Nix functions for filtering local git sources
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Reads multiple gitignore sources including parent, user, and subdirectory rules, closely mimicking git behavior without requiring team-wide changes, as highlighted in the features list.
Ensures source hashes only change with output modifications, providing deterministic Nix builds, which is a key advantage over alternatives like fetchGit per the comparison table.
Avoids descending into ignored directories, improving evaluation speed on large repositories with many ignored files, as noted in the performance benefits section.
Evaluates purely without import-from-derivation, making it compatible with restricted evaluation modes like Hydra, a strength emphasized in the features and comparison.
Unaware of files in the git index, meaning it might exclude files that git would include, as admitted in the README note about not emulating git's full behavior.
Does not understand git-crypt metadata, posing a risk if used with directories containing encrypted secrets, as warned in the security section of the README.
Installation requires manual SHA updates in plain Nix or dependency management with tools like Niv, which can be verbose compared to built-in Nix solutions, as shown in the installation examples.