Use a combined cache derivation by default

This commit is contained in:
Stéphan Kochen
2024-02-06 11:00:23 +01:00
parent 67fadc3f61
commit df1c72a4f6
13 changed files with 328 additions and 146 deletions
+8 -2
View File
@@ -1,7 +1,7 @@
import { Hooks, Plugin, SettingsType } from "@yarnpkg/core";
import { PortablePath } from "@yarnpkg/fslib";
import FetchOneCommand from "./FetchOneCommand";
import FetchCommand from "./FetchCommand";
import InjectBuildCommand from "./InjectBuildCommand";
import InstallBinCommand from "./InstallBinCommand";
import generate from "./generate";
@@ -12,13 +12,14 @@ declare module "@yarnpkg/core" {
nixExprPath: PortablePath;
generateDefaultNix: boolean;
enableNixPreload: boolean;
individualNixPackaging: boolean;
isolatedNixBuilds: string[];
installNixBinariesForDependencies: boolean;
}
}
const plugin: Plugin<Hooks> = {
commands: [FetchOneCommand, InjectBuildCommand, InstallBinCommand],
commands: [FetchCommand, InjectBuildCommand, InstallBinCommand],
hooks: {
afterAllInstalled: async (project, opts) => {
if (
@@ -50,6 +51,11 @@ const plugin: Plugin<Hooks> = {
type: SettingsType.BOOLEAN,
default: true,
},
individualNixPackaging: {
description: `If true, generate one Nix derivation per package. If false, use a single derivation for the entire cache folder.`,
type: SettingsType.BOOLEAN,
default: false,
},
isolatedNixBuilds: {
description: `Dependencies with a build step that can be built in an isolated derivation`,
type: SettingsType.STRING,