Fix Catalina

This commit is contained in:
Domen Kožar 2019-11-07 10:10:36 +01:00
parent 65ed8d8b59
commit 4ad20b153f
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246
3 changed files with 12 additions and 3 deletions

View file

@ -1,7 +1,7 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as tc from '@actions/tool-cache';
import {homedir, userInfo} from 'os';
import {homedir, userInfo, type} from 'os';
import {existsSync} from 'fs';
async function run() {
@ -18,6 +18,11 @@ async function run() {
// Set jobs to number of cores
await exec.exec("sudo", ["sh", "-c", "echo max-jobs = auto >> /etc/nix/nix.conf"]);
// Catalina workaround https://github.com/NixOS/nix/issues/2925
if (type() == "Darwin") {
await exec.exec("sudo", ["mount", "-uw", "/"]);
}
// TODO: retry due to all the things that go wrong
const nixInstall = await tc.downloadTool('https://nixos.org/nix/install');
await exec.exec("sh", [nixInstall]);