libansilove
libansilove copied to clipboard
Add Nix flake
Add Nix flake and contributor automation.
Summary
- document the automation guidelines in
AGENTS.mdso future helpers know the repository conventions up front - add
.envrcto auto-load the Nix flake for contributors who opt into direnv - ship a
flake.nix+flake.lockpairing that builds libansilove and exposes a dev shell with clang and the right debugger per platform - extend
.gitignoreso the flake'sresult*outputs and direnv state never pollute commits
Why keep the flake in-tree?
- Streamlined onboarding: README already calls out cross-platform dependency setup (BSDs, Linux, macOS); the flake captures those packages once so new contributors land in a working shell instantly, with pkg-config, clang tools, and GD pre-wired.
- Nix packaging parity: libansilove is in nixpkgs today. This flake lets us validate packaging updates locally without leaving the repo, which reduces churn for the maintainer shepherding upstream bumps.
- Reproducible tooling: Maintainers like @fcambus who juggle multiple projects can rely on Nix to supply consistent compilers, lint tooling, and GD even on Apple Silicon—no conflicts with Homebrew or system packages.
- Optional, zero-risk: Nothing in the CMake flow changes. Builders who do not use Nix continue with the documented
mkdir build && cmake .. && makepath; the flake is additive and kept tidy via.gitignore.
Testing
nix develop --command echo oknix buildnix flake check --all-systems