feat: Add source filter

This commit is contained in:
uttarayan21
2024-06-19 13:15:55 +05:30
parent 7712c65764
commit 046724c860
+12 -2
View File
@@ -15,7 +15,6 @@
};
outputs = {
self,
crane,
flake-utils,
nixpkgs,
@@ -40,7 +39,18 @@
# Extra targets if required
};
craneLib = (crane.mkLib pkgs).overrideToolchain stableToolchain;
src = craneLib.path ./.;
src = let
htmlFilter = path: _type: builtins.match ".*html$" path != null;
htmlOrCargo = path: type:
(htmlFilter path type) || (craneLib.filterCargoSources path type);
in
lib.cleanSourceWith {
src = ./.;
filter = htmlOrCargo;
name = "source"; # Be reproducible, regardless of the directory name
};
# src = craneLib.path ./.;
commonArgs = {
inherit src;
buildInputs = with pkgs;