From ba979b5e7dbcc6f8f16bfc341165c34de58bf911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Thu, 3 Oct 2019 16:44:00 +0200 Subject: [PATCH] fix #5: set max-jobs = auto --- lib/main.js | 4 +++- src/main.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index bda2e4ee..97ae9985 100644 --- a/lib/main.js +++ b/lib/main.js @@ -30,7 +30,9 @@ function run() { const CERTS_PATH = home + '/.nix-profile/etc/ssl/certs/ca-bundle.crt'; // Workaround a segfault: https://github.com/NixOS/nix/issues/2733 yield exec.exec("sudo", ["mkdir", "-p", "/etc/nix"]); - yield exec.exec("sudo", ["echo", "http2 = false", ">>", "/etc/nix/nix.conf"]); + yield exec.exec("sudo", ["sh", "-c", "echo http2 = false >> /etc/nix/nix.conf"]); + // Set jobs to number of cores + yield exec.exec("sudo", ["sh", "-c", "echo max-jobs = auto >> /etc/nix/nix.conf"]); // TODO: retry due to all the things that go wrong const nixInstall = yield tc.downloadTool('https://nixos.org/nix/install'); yield exec.exec("sh", [nixInstall]); diff --git a/src/main.ts b/src/main.ts index f6941e88..2ed508a1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -13,7 +13,10 @@ async function run() { // Workaround a segfault: https://github.com/NixOS/nix/issues/2733 await exec.exec("sudo", ["mkdir", "-p", "/etc/nix"]); - await exec.exec("sudo", ["echo", "http2 = false", ">>", "/etc/nix/nix.conf"]); + await exec.exec("sudo", ["sh", "-c", "echo http2 = false >> /etc/nix/nix.conf"]); + + // Set jobs to number of cores + await exec.exec("sudo", ["sh", "-c", "echo max-jobs = auto >> /etc/nix/nix.conf"]); // TODO: retry due to all the things that go wrong const nixInstall = await tc.downloadTool('https://nixos.org/nix/install');