feat: Add source filter
This commit is contained in:
@@ -15,7 +15,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
self,
|
|
||||||
crane,
|
crane,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
@@ -40,7 +39,18 @@
|
|||||||
# Extra targets if required
|
# Extra targets if required
|
||||||
};
|
};
|
||||||
craneLib = (crane.mkLib pkgs).overrideToolchain stableToolchain;
|
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 = {
|
commonArgs = {
|
||||||
inherit src;
|
inherit src;
|
||||||
buildInputs = with pkgs;
|
buildInputs = with pkgs;
|
||||||
|
|||||||
Reference in New Issue
Block a user