From 5a3e6089b4e373e74b4050778ca5b09ef42acc54 Mon Sep 17 00:00:00 2001 From: cy Date: Sat, 26 Apr 2025 14:40:38 -0400 Subject: [PATCH] don't clean cpp files --- flake.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index e43527f..01d135a 100644 --- a/flake.nix +++ b/flake.nix @@ -23,7 +23,16 @@ toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; craneLib = (crane.mkLib pkgs).overrideToolchain(_: toolchain); lib = pkgs.lib; - src = craneLib.cleanCargoSource ./.; + + # don't clean cpp files + cppFilter = path: _type: builtins.match ".*(cpp|hpp)$" path != null; + cppOrCargo = path: type: + (cppFilter path type) || (craneLib.filterCargoSources path type); + src = lib.cleanSourceWith { + src = ./.; + filter = cppOrCargo; + name = "source"; + }; commonArgs = { inherit src;