Repository navigation
Conversation
Co-authored-by: faldor20 <[email protected]>
Copilot
AI
changed the title
[WIP] Add flake with package and devshell outputs
Add Nix flake with package and devShell outputs
Mar 11, 2026
Add the Linux linker tools and keep compile-time prompt assets in the filtered source so nix builds succeed inside the sandbox. This keeps the flake aligned with the repo's Cargo linker config and embedded prompt files.
zombi3butt
pushed a commit
to zombi3butt/jcode
that referenced
this pull request
May 22, 2026
Adds a Nix flake at the repo root so users on NixOS / nix-darwin / home-manager can: nix run github:quangdang46/jcode nix profile install github:quangdang46/jcode nix develop github:quangdang46/jcode The flake uses crane (https://github.com/ipetkov/crane) for cached dep-only builds + a final binary build, mirroring the structure referenced in faldor20#1. Outputs: - packages.default / packages.jcode — release binary. - devShells.default — Rust nightly + cargo-nextest, cargo-watch, sccache, rust-analyzer; sets RUSTC_WRAPPER=sccache automatically. - apps.default — runnable jcode entry point for `nix run`. - checks.jcode-clippy + checks.jcode-fmt — the same guardrails CI enforces, runnable via `nix flake check`. build.rs reads git metadata (JCODE_GIT_HASH, JCODE_GIT_DATE). Nix typically strips .git/, so the flake passes deterministic values derived from `self.rev` / `self.lastModifiedDate`. System dependencies covered: Linux: openssl, libxcb, xorg.libX11, libusb1 macOS: AppKit, Security, SystemConfiguration, CoreFoundation, Metal README.md gets a new "Nix flake" section between Homebrew and "Verifying release artifacts". Closes 1jehuang#95
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
flake.nixso jcode can be built and developed via Nix following modern best practices.Flake outputs
packages.default— builds thejcodebinary viacrane; dependency compilation is a separate cached derivation so incremental rebuilds are fastdevShells.default— stable Rust toolchain (rust-analyzer,rustfmt,clippy) pluscargo-watchandcargo-edit;RUST_SRC_PATHwired for IDE integrationchecks— clippy (deny warnings) +cargo fmt, runnable withnix flake checkSupporting changes
Cargo.lockcommitted — required forcraneto vendor deps offline in the Nix sandbox; conventional for binary crates anyway.gitignore— removedCargo.lockentryBuild env vars
build.rsprobes git at compile time. The flake sets static overrides so the sandbox build succeeds:System deps
openssl,libxcb,libX11AppKit,Security,SystemConfigurationUsage
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/1jehuang/mermaid-rs-renderer/commits/v0.2.1/home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/bin/cargo /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/bin/cargo generate-lockfile(http block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.