From 9130accbad30d69fcfbbe9c990c90fb3f61f9a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Sun, 10 Nov 2019 19:22:39 +0100 Subject: [PATCH] try out catalina fix --- lib/main.js | 6 +++++- src/main.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index a4183df..c79b8f9 100644 --- a/lib/main.js +++ b/lib/main.js @@ -27,6 +27,7 @@ function run() { const home = os_1.homedir(); const { username } = os_1.userInfo(); const PATH = process.env.PATH; + const INSTALL_PATH = '/opt/nix'; 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"]); @@ -35,7 +36,10 @@ function run() { yield exec.exec("sudo", ["sh", "-c", "echo max-jobs = auto >> /etc/nix/nix.conf"]); // Catalina workaround https://github.com/NixOS/nix/issues/2925 if (os_1.type() == "Darwin") { - yield exec.exec("sudo", ["mount", "-uw", "/"]); + yield exec.exec("sudo", ["sh", "-c", `echo \"nix\t${INSTALL_PATH}\" >> /etc/synthetic.conf`]); + yield exec.exec("sudo", ["sh", "-c", `mkdir -m 0755 ${INSTALL_PATH} && chown runner ${INSTALL_PATH}`]); + yield exec.exec("/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util", ["-B"]); + core.exportVariable('NIX_IGNORE_SYMLINK_STORE', "1"); } // TODO: retry due to all the things that go wrong const nixInstall = yield tc.downloadTool('https://nixos.org/nix/install'); diff --git a/src/main.ts b/src/main.ts index 195dc6a..039c72f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -9,6 +9,7 @@ async function run() { const home = homedir(); const {username} = userInfo(); const PATH = process.env.PATH; + const INSTALL_PATH = '/opt/nix'; const CERTS_PATH = home + '/.nix-profile/etc/ssl/certs/ca-bundle.crt'; // Workaround a segfault: https://github.com/NixOS/nix/issues/2733 @@ -20,7 +21,10 @@ async function run() { // Catalina workaround https://github.com/NixOS/nix/issues/2925 if (type() == "Darwin") { - await exec.exec("sudo", ["mount", "-uw", "/"]); + await exec.exec("sudo", ["sh", "-c", `echo \"nix\t${INSTALL_PATH}\" >> /etc/synthetic.conf`]); + await exec.exec("sudo", ["sh", "-c", `mkdir -m 0755 ${INSTALL_PATH} && chown runner ${INSTALL_PATH}`]); + await exec.exec("/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util", ["-B"]); + core.exportVariable('NIX_IGNORE_SYMLINK_STORE', "1"); } // TODO: retry due to all the things that go wrong