Isolated builds of dependencies

This commit is contained in:
Stéphan Kochen
2021-04-30 11:39:05 +02:00
parent 0f378786d6
commit 153254f62a
14 changed files with 578 additions and 133 deletions
+11
View File
@@ -60,3 +60,14 @@ export const computeFixedOutputStorePath = (
return ppath.join(storePath, `${outerHash32}-${name}` as Filename);
};
/**
* Creates a valid derivation name from a potentially invalid one.
*
* Matches lib.strings.sanitizeDerivationName in Nixpkgs.
*/
export const sanitizeDerivationName = (name: string) =>
name
.replace(/^\.+/, "")
.replace(/[^a-zA-Z0-9+._?=-]+/g, "-")
.slice(0, 207) || "unknown";