diff --git a/nix/package.nix b/nix/package.nix index 3556b28..3c997c5 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -7,27 +7,28 @@ pnpmConfigHook, git, siteUrl, - sourcePath ? ./.. + sourcePath ? ./.., }: let nodejs = nodejs_latest; pnpm = pnpm_10; - + # Filter source: use cleanSourceFilter as base, but include .git and exclude _site filteredSrc = lib.cleanSourceWith { src = sourcePath; - filter = path: type: - let - baseName = baseNameOf path; - # Always include .git directory - isGit = baseName == ".git" || lib.hasInfix "/.git/" path || lib.hasSuffix "/.git" path; - in - isGit || ( - # Apply base cleanSourceFilter - lib.cleanSourceFilter path type && - # Additional exclusions - baseName != "_site" && - baseName != "node_modules" - ); + filter = path: type: let + baseName = baseNameOf path; + # Always include .git directory + isGit = baseName == ".git" || lib.hasInfix "/.git/" path || lib.hasSuffix "/.git" path; + in + isGit + || ( + # Apply base cleanSourceFilter + lib.cleanSourceFilter path type + && + # Additional exclusions + baseName != "_site" + && baseName != "node_modules" + ); }; in stdenv.mkDerivation (finalAttrs: { @@ -48,7 +49,7 @@ in pnpmDeps = fetchPnpmDeps { inherit (finalAttrs) pname version; src = lib.cleanSource sourcePath; - hash = "sha256-rN8P6g/Wuug+fv0rm/qbKN01NgcbpgEQmhDFe2X42uA="; + hash = "sha256-OaSZ8eY6idDv16BhmOTkOeis19SXjPRg+QUtf68TDQI="; fetcherVersion = 3; # pnpm store version }; @@ -68,4 +69,4 @@ in runHook postInstall ''; - }) \ No newline at end of file + })