From 4969fb6f2888d45efbbb6aa3fb620b6b6b7c4c05 Mon Sep 17 00:00:00 2001 From: Mark Keller <8452750+keller00@users.noreply.github.com> Date: Sun, 1 Feb 2026 20:56:53 -0800 Subject: [PATCH 1/5] build: use nix-shell for development --- .envrc | 1 + shell.nix | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .envrc create mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..1d953f4 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..f226693 --- /dev/null +++ b/shell.nix @@ -0,0 +1,15 @@ +let + nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/41e216c0ca66c83b12ab7a98cc326b5db01db646.tar.gz"; + pkgs = import nixpkgs { config = {}; overlays = []; }; +in + +pkgs.mkShellNoCC { + packages = with pkgs; [ + rustc + cargo + rustfmt + clippy + rust-analyzer + sqlite + ]; +} From 7490d04c236af572fe901f8af64649067183297a Mon Sep 17 00:00:00 2001 From: Mark Keller <8452750+keller00@users.noreply.github.com> Date: Mon, 9 Feb 2026 20:43:08 -0800 Subject: [PATCH 2/5] ci: install nix instead of rust to build --- .github/workflows/build-and-release.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index b054f4f..7d16cb5 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -24,18 +24,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.target }} - override: true + - name: Install Nix + uses: cachix/install-nix-action@v31 - name: Build - uses: actions-rs/cargo@v1 - with: - command: build - args: --verbose --release --target ${{ matrix.target }} + run: nix-shell --command "cargo build --verbose --release --target ${{ matrix.target }}" - name: Strip binaries (Linux) if: matrix.target == 'x86_64-unknown-linux-gnu' From 2cc6625f5ad0bcff820906ff4b24b6eb105b6504 Mon Sep 17 00:00:00 2001 From: Mark Keller <8452750+keller00@users.noreply.github.com> Date: Mon, 9 Feb 2026 22:25:17 -0800 Subject: [PATCH 3/5] ci: migrate coverage.yml to install nix instead of rust --- .github/workflows/coverage.yml | 8 +++----- shell.nix | 9 ++++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index dde9647..ec52980 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -11,12 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update stable - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov + - name: Install Nix + uses: cachix/install-nix-action@v31 - name: Generate code coverage - run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + run: nix-shell --command "cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info" - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: diff --git a/shell.nix b/shell.nix index f226693..81d973f 100644 --- a/shell.nix +++ b/shell.nix @@ -3,13 +3,20 @@ let pkgs = import nixpkgs { config = {}; overlays = []; }; in -pkgs.mkShellNoCC { +pkgs.mkShell { packages = with pkgs; [ rustc cargo + cargo-llvm-cov + rustc.llvmPackages.llvm rustfmt clippy rust-analyzer sqlite ]; + + shellHook = '' + export LLVM_COV=${pkgs.llvm}/bin/llvm-cov + export LLVM_PROFDATA=${pkgs.llvm}/bin/llvm-profdata + ''; } From fb447c5d27e4dc940d42ce0d7db7b34c46075f3c Mon Sep 17 00:00:00 2001 From: Mark Keller <8452750+keller00@users.noreply.github.com> Date: Mon, 6 Apr 2026 19:58:32 -0700 Subject: [PATCH 4/5] chore: add hooky to nix shell --- shell.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell.nix b/shell.nix index 81d973f..b1eaa86 100644 --- a/shell.nix +++ b/shell.nix @@ -1,13 +1,14 @@ let - nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/41e216c0ca66c83b12ab7a98cc326b5db01db646.tar.gz"; + nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/83e29f2b8791f6dec20804382fcd9a666d744c07.tar.gz"; pkgs = import nixpkgs { config = {}; overlays = []; }; in pkgs.mkShell { packages = with pkgs; [ - rustc + hooky cargo cargo-llvm-cov + rustc rustc.llvmPackages.llvm rustfmt clippy From 6aac60cb65c695a59287864d071ebe737e5acc20 Mon Sep 17 00:00:00 2001 From: Mark Keller <8452750+keller00@users.noreply.github.com> Date: Mon, 6 Apr 2026 20:00:18 -0700 Subject: [PATCH 5/5] ci: updating hooky action --- .github/workflows/hooky.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/hooky.yml b/.github/workflows/hooky.yml index 4f95a96..881c717 100644 --- a/.github/workflows/hooky.yml +++ b/.github/workflows/hooky.yml @@ -13,21 +13,9 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - uses: moonrepo/setup-rust@v1 - - name: Download Hooky binary - id: download - run: | - TAG="v1.0.0" - ASSET="hooky-${TAG#v}-linux-x86_64" - URL="https://github.com/brandonchinn178/hooky/releases/download/${TAG}/${ASSET}" - echo "Downloading $URL" - sudo curl -L -o /usr/bin/hooky "${URL}" - sudo chmod +x /usr/bin/hooky - - name: Verify dependency versions - run: | - hooky --version - rustfmt --version + - name: Install Nix + uses: cachix/install-nix-action@v31 - name: Execute hooks - run: hooky run --all --format=verbose + run: nix-shell --command "hooky run --all --format=verbose" env: SKIP: no_commit_to_branch