From a70411fd1d4c76b252d452a02807e14f593333f1 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Thu, 7 Nov 2024 16:40:19 -0700 Subject: [PATCH] Exclude more paths from colmena.src to reduce rebuilds --- .srcignore | 18 ++++++++++++++++++ package.nix | 18 ++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 .srcignore diff --git a/.srcignore b/.srcignore new file mode 100644 index 0000000..d104ee6 --- /dev/null +++ b/.srcignore @@ -0,0 +1,18 @@ +# Exclusions from source distribution +# +# Files listed here will not be part of colmena.src + +/.github +/CNAME +/renovate.json + +/manual +/integration-tests + +/nix +/default.nix +/flake-compat.nix +/package.nix +/shell.nix + +# vim: set ft=gitignore: diff --git a/package.nix b/package.nix index a4b4b9f..c0379ec 100644 --- a/package.nix +++ b/package.nix @@ -1,18 +1,16 @@ -{ lib, stdenv, rustPlatform, installShellFiles, nix-eval-jobs }: +{ lib +, stdenv +, rustPlatform +, nix-gitignore +, installShellFiles +, nix-eval-jobs +}: rustPlatform.buildRustPackage rec { pname = "colmena"; version = "0.5.0-pre"; - src = lib.cleanSourceWith { - filter = name: type: !(type == "directory" && builtins.elem (baseNameOf name) [ - ".github" - "target" - "manual" - "integration-tests" - ]); - src = lib.cleanSource ./.; - }; + src = nix-gitignore.gitignoreSource [ ./.srcignore ] ./.; cargoLock = { lockFile = ./Cargo.lock;