libansilove icon indicating copy to clipboard operation
libansilove copied to clipboard

Add Nix flake

Open subtleGradient opened this issue 3 months ago • 0 comments

Add Nix flake and contributor automation.

Summary

  • document the automation guidelines in AGENTS.md so future helpers know the repository conventions up front
  • add .envrc to auto-load the Nix flake for contributors who opt into direnv
  • ship a flake.nix + flake.lock pairing that builds libansilove and exposes a dev shell with clang and the right debugger per platform
  • extend .gitignore so the flake's result* 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 .. && make path; the flake is additive and kept tidy via .gitignore.

Testing

  • nix develop --command echo ok
  • nix build
  • nix flake check --all-systems

subtleGradient avatar Sep 18 '25 23:09 subtleGradient