Skip to content

[RFC] Add Nix Flake for Development and Distribution #115

Open

Description

@Spirizeon

Summary

Add a flake.nix to enable building and developing jcode via Nix, following modern best practices.

Motivation

  • Provide a reproducible build system for Nix users
  • Enable nix develop for contributors with a ready-made dev environment
  • Support NixOS distribution via flake inputs
  • Alternative to existing installation methods (Homebrew, install scripts)

Existing Work

A community fork (faldor20#1) already has a working flake implementation that could be referenced:

  • Uses crane for Rust builds
  • Includes devShell with rust-analyzer, rustfmt, clippy
  • CI checks (clippy + cargo fmt)
  • Sets required build env vars for git metadata in build.rs

Proposed Approach

  1. Add flake.nix to root of repository
  2. Use crane for deterministic builds with dependency caching
  3. Include:
    • packages.default - build jcode binary
    • devShells.default - development environment
    • checks - clippy + fmt validation
  4. Document in README under "Installation" section

System Dependencies

  • Linux: openssl, libxcb, libX11
  • macOS: AppKit, Security, SystemConfiguration (system libs)

Questions for Maintainer

  • Should we also pursue adding to official nixpkgs? (requires Cargo.lock in repo)
  • Preferred approach for versioning/updates?

References

Activity

  1. added
    enhancement
    priority: low
    triage: needs-decision
    on May 31, 2026
  2. grigio commented on Jul 31, 2026

    @grigio

    +1 for nix

  3. grigio commented on Aug 3, 2026

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority: lowtriage: needs-decision

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions