Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

+ Nix flake#47

Open
subtleGradient wants to merge 10 commits intoansilove:masterfrom
effect-native:nix-flake
Open

+ Nix flake#47
subtleGradient wants to merge 10 commits intoansilove:masterfrom
effect-native:nix-flake

Conversation

@subtleGradient
Copy link

@subtleGradient subtleGradient commented Sep 18, 2025

EDIT: also allows running ansilove without installing it first via nix like this:

nix run 'github:effect-native/ansilove?ref=nix-flake' -- -h

and if you accept this PR then also:

nix run github:ansilove/ansilove -- -h

Summary

  • add a reproducible nix develop shell that carries the right libs and toolchain with zero system deps.
  • expose nix run / nix build entry points so downstreams (or CI) can fetch and execute the CLI without cloning or manual CMake steps.
  • document the workflow in AGENTS.md so future contributors know how to use the flake.

Why it matters

  • ensures everyone, including CI, has the same headers/libraries: no more "missing libansilove/gd" configure failures.
  • speeds up onboarding; nix develop replaces manual brewing of dependencies.
  • keeps binary artifacts out of the tree: .cache, .direnv, result, and test PNGs are ignored.
  • enabling nix run github:effect-native/ansilove -h makes distribution trivial for users and web demos.
  • flakes unlock cross-platform checks (nix flake check --all-systems) so regressions on Linux/macOS get caught early.

Testing

  • nix flake check --all-systems
  • nix develop .#default --command bash -lc 'cmake -S . -B build && cmake --build build && ctest --test-dir build --output-on-failure'
  • nix build .#default
  • nix run . -- -h

This commit introduces a Nix flake to manage the C development environment for AnsiLove. It includes the necessary dependencies like
`cmake`, `ninja`, `pkg-config`, `clang`, `libansilove`, `gd`, `zlib`, and `libpng`. The `devShells.default` is configured to set up
`CMAKE_PREFIX_PATH` and `PKG_CONFIG_PATH` for proper dependency discovery.
Copilot AI review requested due to automatic review settings September 18, 2025 23:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a Nix flake to provide reproducible development environment and distribution for AnsiLove/C. The flake ensures consistent dependencies across platforms and eliminates system-specific build issues.

  • Adds a complete Nix flake with development shell, build package, and app entry points
  • Creates comprehensive developer documentation in AGENTS.md covering build workflows and coding standards
  • Configures direnv integration for automatic environment loading

Reviewed Changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

File Description
flake.nix Complete Nix flake definition with development shell, package build, and app configuration
AGENTS.md Comprehensive developer documentation including Nix workflows, coding standards, and testing guidelines
CLAUDE.md Single line file containing "AGENTS.md"
.envrc Direnv configuration to automatically load the Nix flake environment

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant