feat: fixed new build with deps
This commit is contained in:
parent
53c25c9da3
commit
f5009d09bb
1 changed files with 18 additions and 17 deletions
|
|
@ -7,27 +7,28 @@
|
||||||
pnpmConfigHook,
|
pnpmConfigHook,
|
||||||
git,
|
git,
|
||||||
siteUrl,
|
siteUrl,
|
||||||
sourcePath ? ./..
|
sourcePath ? ./..,
|
||||||
}: let
|
}: let
|
||||||
nodejs = nodejs_latest;
|
nodejs = nodejs_latest;
|
||||||
pnpm = pnpm_10;
|
pnpm = pnpm_10;
|
||||||
|
|
||||||
# Filter source: use cleanSourceFilter as base, but include .git and exclude _site
|
# Filter source: use cleanSourceFilter as base, but include .git and exclude _site
|
||||||
filteredSrc = lib.cleanSourceWith {
|
filteredSrc = lib.cleanSourceWith {
|
||||||
src = sourcePath;
|
src = sourcePath;
|
||||||
filter = path: type:
|
filter = path: type: let
|
||||||
let
|
baseName = baseNameOf path;
|
||||||
baseName = baseNameOf path;
|
# Always include .git directory
|
||||||
# Always include .git directory
|
isGit = baseName == ".git" || lib.hasInfix "/.git/" path || lib.hasSuffix "/.git" path;
|
||||||
isGit = baseName == ".git" || lib.hasInfix "/.git/" path || lib.hasSuffix "/.git" path;
|
in
|
||||||
in
|
isGit
|
||||||
isGit || (
|
|| (
|
||||||
# Apply base cleanSourceFilter
|
# Apply base cleanSourceFilter
|
||||||
lib.cleanSourceFilter path type &&
|
lib.cleanSourceFilter path type
|
||||||
# Additional exclusions
|
&&
|
||||||
baseName != "_site" &&
|
# Additional exclusions
|
||||||
baseName != "node_modules"
|
baseName != "_site"
|
||||||
);
|
&& baseName != "node_modules"
|
||||||
|
);
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
@ -48,7 +49,7 @@ in
|
||||||
pnpmDeps = fetchPnpmDeps {
|
pnpmDeps = fetchPnpmDeps {
|
||||||
inherit (finalAttrs) pname version;
|
inherit (finalAttrs) pname version;
|
||||||
src = lib.cleanSource sourcePath;
|
src = lib.cleanSource sourcePath;
|
||||||
hash = "sha256-rN8P6g/Wuug+fv0rm/qbKN01NgcbpgEQmhDFe2X42uA=";
|
hash = "sha256-OaSZ8eY6idDv16BhmOTkOeis19SXjPRg+QUtf68TDQI=";
|
||||||
fetcherVersion = 3; # pnpm store version
|
fetcherVersion = 3; # pnpm store version
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -68,4 +69,4 @@ in
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue