diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 4590f6d7..75e1696a 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -6,12 +6,14 @@ on: paths: - "**/*.nix" - "flake.lock" + - "rust-toolchain.toml" pull_request: branches: ["main", "develop"] types: [opened, synchronize, reopened, ready_for_review] paths: - "**/*.nix" - "flake.lock" + - "rust-toolchain.toml" concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -32,5 +34,11 @@ jobs: - name: Magic Nix Cache uses: DeterminateSystems/magic-nix-cache-action@v6 - - name: Check full devShell + - name: Warm up full devShell run: nix develop .#full --command true + + - name: Cargo check in flake environment + run: nix develop .#full --command cargo check + + - name: Cargo build in flake environment + run: nix develop .#full --command cargo build diff --git a/flake.nix b/flake.nix index c33ab483..81650da5 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,7 @@ rust protobuf clang + mold pkg-config bridge-utils # for three node test ] @@ -98,6 +99,10 @@ KCP_SYS_EXTRA_HEADER_PATH = "${pkgs.libclang.lib}/lib/clang/19/include:${pkgs.glibc.dev}/include"; JEMALLOC_OVERRIDE = "${pkgs.jemalloc}/lib/libjemalloc.so"; } + // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux { + CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = "clang"; + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER = "clang"; + } // (if hasFeature "android" then android.envVars else { })); in {