Skip to content

Add Nix flake for Compact compiler#1163

Open
solidsnakedev wants to merge 9 commits intomidnightntwrk:mainfrom
solidsnakedev:main
Open

Add Nix flake for Compact compiler#1163
solidsnakedev wants to merge 9 commits intomidnightntwrk:mainfrom
solidsnakedev:main

Conversation

@solidsnakedev
Copy link

Adds Nix flake that provides compactc, compactc.bin, and zkir binaries per system.

- Downloads compactc, compactc.bin, and zkir per system
- Supports x86_64-linux, x86_64-darwin, aarch64-darwin
- Version-aware installation with automatic updates
- Sets PATH and ZKIR_BIN environment variables
- Includes latest Node.js from nixpkgs-unstable
@solidsnakedev solidsnakedev requested a review from a team as a code owner August 7, 2025 20:38
@solidsnakedev solidsnakedev requested a review from a team August 7, 2025 20:38
@CLAassistant
Copy link

CLAassistant commented Aug 7, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@solidsnakedev
Copy link
Author

@gilescope what else do we need to get this approve?
is it because of CI Checkmarx failing?

Creating directory
flag needs an argument: --scs-repo-token
Error: flag needs an argument: --scs-repo-token
PR decoration not created.
Scan failed

@jonathanfishbein1
Copy link

Hi I'm really looking forward to this PR. Global user installation of the compiler toolchain is clunky. I was attampting to make use of this flake but was running into some issues. Ironically I think this doesn't quite work for use on NixOS. Here's a link discussing the quirks of NixOS with Midnight

https://forum.midnight.network/t/error-failed-to-run-compactc/500

I could be missing something. Let me know if and how I can assist

Copilot AI review requested due to automatic review settings October 8, 2025 18:44
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 adds Nix flake support to provide the Compact compiler toolchain for different systems. The implementation downloads and installs Compact developer tools in a project-local directory.

Key Changes:

  • Adds a Nix flake configuration with multi-system support (x86_64-linux, x86_64-darwin, aarch64-darwin)
  • Creates a dev shell that automatically installs and sets up the Compact compiler toolchain version 0.24.0
  • Includes direnv configuration for automatic environment activation

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 4 comments.

File Description
flake.nix Defines Nix flake with dev shell that downloads and configures Compact toolchain
.envrc Adds direnv integration to automatically enter Nix development shell

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

flake.nix Outdated
@@ -0,0 +1,60 @@
{
description = "Example Counter – Nix flake that provides the Compact compiler per system";
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

The description mentions 'Example Counter' which appears to be a copy-paste error. It should describe the actual Compact compiler flake.

Suggested change
description = "Example Counter – Nix flake that provides the Compact compiler per system";
description = "Nix flake that provides the Compact compiler per system";

Copilot uses AI. Check for mistakes.
@solidsnakedev solidsnakedev requested a review from a team as a code owner October 30, 2025 00:15
@solidsnakedev
Copy link
Author

@jonathanfishbein1 I fixed it. This is a common problem in NixOS, most Linux distributions use bin/bash instead of #!/usr/bin/env bash. The solution is to patch the bash script used by compactc

If there are no more observations, I suggest we merge the PR? @gilescope @Olanetsoft

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.

5 participants