From a95a3e7f68cf85a03a645378778bce5bf42bb414 Mon Sep 17 00:00:00 2001 From: "guillem.cordoba" Date: Fri, 27 Sep 2024 10:50:44 +0200 Subject: [PATCH] Added cleanPnpmSources --- flake.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/flake.nix b/flake.nix index ce1f56a..15dbc21 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = [