Skip to content

Commit

Permalink
Added cleanPnpmSources
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Sep 27, 2024
1 parent 9bb0df4 commit a95a3e7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,32 @@
flake = {
flakeModules.builders = ./nix/builders-option.nix;
flakeModules.dependencies = ./nix/dependencies-option.nix;

lib = rec {
filterPnpmSources = { lib }:
orig_path: type:
let
path = (toString orig_path);
base = baseNameOf path;

matchesSuffix = lib.any (suffix: lib.hasSuffix suffix base) [
".ts"
".js"
".json"
".yaml"
".html"
];
in type == "directory" || matchesSuffix;
cleanPnpmDepsSource = { lib }:
src:
lib.cleanSourceWith {
src = lib.cleanSource src;
filter = filterPnpmSources { inherit lib; };

name = "pnpm-workspace";
};

};
};

imports = [
Expand Down

0 comments on commit a95a3e7

Please sign in to comment.