From cc13b97995da61c194d23bf0a360c38f84e2f7d8 Mon Sep 17 00:00:00 2001 From: furedea <132188853+furedea@users.noreply.github.com> Date: Mon, 9 Nov 2026 21:38:39 +0900 Subject: [PATCH 1/3] build(nix): provide the dev shell for x86_64-linux Co-Authored-By: Claude Sonnet 5.5 --- flake.nix | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/flake.nix b/flake.nix index 58caf1b..73ec927 100644 --- a/flake.nix +++ b/flake.nix @@ -9,26 +9,37 @@ outputs = { nixpkgs, nixpkgs-unstable, ... }: let - system = "aarch64-darwin"; - pkgs = import nixpkgs { inherit system; }; + systems = [ + "aarch64-darwin" + "x86_64-linux" + ]; + forAllSystems = nixpkgs.lib.genAttrs systems; in { - devShells.${system}.default = pkgs.mkShell { - packages = with pkgs; [ - cargo - cargo-deny - cargo-machete - clippy - commitlint - deadnix - # lefthook before 2.1.6 runs hooks under a pty, which agent sandboxes deny. - nixpkgs-unstable.legacyPackages.${system}.lefthook - ls-lint - nixfmt - rustc - rustfmt - statix - ]; - }; + devShells = forAllSystems ( + system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + default = pkgs.mkShell { + packages = with pkgs; [ + cargo + cargo-deny + cargo-machete + clippy + commitlint + deadnix + # lefthook before 2.1.6 runs hooks under a pty, which agent sandboxes deny. + nixpkgs-unstable.legacyPackages.${system}.lefthook + ls-lint + nixfmt + rustc + rustfmt + statix + ]; + }; + } + ); }; } From 0838647657fde34c5f60aa620754c9d6edf2077d Mon Sep 17 00:00:00 2001 From: furedea <132188853+furedea@users.noreply.github.com> Date: Mon, 9 Nov 2026 21:39:13 +0900 Subject: [PATCH 2/3] ci: run the Rust tools from the flake dev shell Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2e1b37..b8ede82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,18 +27,17 @@ jobs: timeout-minutes: 10 permissions: contents: read + defaults: + run: + shell: nix develop --command bash -eo pipefail {0} steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Install Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0 - with: - toolchain: stable - components: clippy - rustflags: "" + - name: Set up Nix + uses: furedea/reusable-workflows/.github/actions/nix-setup@RELEASE_SHA # vRELEASE - name: Run clippy run: cargo clippy -- -D warnings @@ -48,18 +47,17 @@ jobs: timeout-minutes: 10 permissions: contents: read + defaults: + run: + shell: nix develop --command bash -eo pipefail {0} steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Install Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0 - with: - toolchain: stable - components: rustfmt - rustflags: "" + - name: Set up Nix + uses: furedea/reusable-workflows/.github/actions/nix-setup@RELEASE_SHA # vRELEASE - name: Run rustfmt run: cargo fmt --check @@ -69,17 +67,17 @@ jobs: timeout-minutes: 10 permissions: contents: read + defaults: + run: + shell: nix develop --command bash -eo pipefail {0} steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Install Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0 - with: - toolchain: stable - rustflags: "" + - name: Set up Nix + uses: furedea/reusable-workflows/.github/actions/nix-setup@RELEASE_SHA # vRELEASE - name: Run tests run: cargo test @@ -89,17 +87,23 @@ jobs: timeout-minutes: 10 permissions: contents: read + defaults: + run: + shell: nix develop --command bash -eo pipefail {0} steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false + - name: Set up Nix + uses: furedea/reusable-workflows/.github/actions/nix-setup@RELEASE_SHA # vRELEASE + - name: Run cargo-deny - uses: EmbarkStudios/cargo-deny-action@6c8f9facfa5047ec02d8485b6bf52b587b7777d1 # v2.0.18 + run: cargo deny check - name: Run cargo-machete - uses: bnjbvr/cargo-machete@ac30a525c0a8d163a92d727b3ff079ee3f6ecb08 # v0.9.2 + run: cargo machete gha-lint: uses: furedea/reusable-workflows/.github/workflows/gha-lint.yml@ca7c5f2973a899e209bc60767f434aecbc186bc9 # v1.1.0 From b469451d4841190dc1b610c8d58aa6e7715a1366 Mon Sep 17 00:00:00 2001 From: furedea <132188853+furedea@users.noreply.github.com> Date: Mon, 9 Nov 2026 21:52:28 +0900 Subject: [PATCH 3/3] ci: pin nix-setup to v1.3.0 Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8ede82..4b343a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: persist-credentials: false - name: Set up Nix - uses: furedea/reusable-workflows/.github/actions/nix-setup@RELEASE_SHA # vRELEASE + uses: furedea/reusable-workflows/.github/actions/nix-setup@2ae953294b9a805d0705657adc1d9d4f1bc1f646 # v1.3.0 - name: Run clippy run: cargo clippy -- -D warnings @@ -57,7 +57,7 @@ jobs: persist-credentials: false - name: Set up Nix - uses: furedea/reusable-workflows/.github/actions/nix-setup@RELEASE_SHA # vRELEASE + uses: furedea/reusable-workflows/.github/actions/nix-setup@2ae953294b9a805d0705657adc1d9d4f1bc1f646 # v1.3.0 - name: Run rustfmt run: cargo fmt --check @@ -77,7 +77,7 @@ jobs: persist-credentials: false - name: Set up Nix - uses: furedea/reusable-workflows/.github/actions/nix-setup@RELEASE_SHA # vRELEASE + uses: furedea/reusable-workflows/.github/actions/nix-setup@2ae953294b9a805d0705657adc1d9d4f1bc1f646 # v1.3.0 - name: Run tests run: cargo test @@ -97,7 +97,7 @@ jobs: persist-credentials: false - name: Set up Nix - uses: furedea/reusable-workflows/.github/actions/nix-setup@RELEASE_SHA # vRELEASE + uses: furedea/reusable-workflows/.github/actions/nix-setup@2ae953294b9a805d0705657adc1d9d4f1bc1f646 # v1.3.0 - name: Run cargo-deny run: cargo deny check