diff --git a/dist/setup.js b/dist/setup.js index 1ee3601..af16e2b 100644 --- a/dist/setup.js +++ b/dist/setup.js @@ -11,6 +11,11 @@ export default async () => { if (process.platform === "win32") { throw new Error("Flox is not supported on Windows"); } + // verify that nix is installed + const { exitCode } = await getExecOutput("nix", ["--version"]); + if (exitCode !== 0) { + throw new Error("Nix is not installed, please install it first, see https://github.com/DeterminateSystems/nix-installer-action"); + } const cacheKey = `floxcache-${process.platform}-${process.arch}`; const cacheEnabled = cache.isFeatureAvailable(); let cacheHit = false; diff --git a/src/setup.ts b/src/setup.ts index 5f6d438..4c7599d 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -16,6 +16,13 @@ export default async (): Promise<{ if (process.platform === "win32") { throw new Error("Flox is not supported on Windows"); } + // verify that nix is installed + const { exitCode } = await getExecOutput("nix", ["--version"]); + if (exitCode !== 0) { + throw new Error( + "Nix is not installed, please install it first, see https://github.com/DeterminateSystems/nix-installer-action" + ); + } const cacheKey = `floxcache-${process.platform}-${process.arch}`; const cacheEnabled = cache.isFeatureAvailable(); let cacheHit = false;