try out catalina fix

This commit is contained in:
Domen Kožar 2019-11-10 19:22:39 +01:00
parent 9c08345130
commit 9130accbad
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246
2 changed files with 10 additions and 2 deletions

View file

@ -27,6 +27,7 @@ function run() {
const home = os_1.homedir(); const home = os_1.homedir();
const { username } = os_1.userInfo(); const { username } = os_1.userInfo();
const PATH = process.env.PATH; const PATH = process.env.PATH;
const INSTALL_PATH = '/opt/nix';
const CERTS_PATH = home + '/.nix-profile/etc/ssl/certs/ca-bundle.crt'; const CERTS_PATH = home + '/.nix-profile/etc/ssl/certs/ca-bundle.crt';
// Workaround a segfault: https://github.com/NixOS/nix/issues/2733 // Workaround a segfault: https://github.com/NixOS/nix/issues/2733
yield exec.exec("sudo", ["mkdir", "-p", "/etc/nix"]); 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"]); yield exec.exec("sudo", ["sh", "-c", "echo max-jobs = auto >> /etc/nix/nix.conf"]);
// Catalina workaround https://github.com/NixOS/nix/issues/2925 // Catalina workaround https://github.com/NixOS/nix/issues/2925
if (os_1.type() == "Darwin") { 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 // TODO: retry due to all the things that go wrong
const nixInstall = yield tc.downloadTool('https://nixos.org/nix/install'); const nixInstall = yield tc.downloadTool('https://nixos.org/nix/install');

View file

@ -9,6 +9,7 @@ async function run() {
const home = homedir(); const home = homedir();
const {username} = userInfo(); const {username} = userInfo();
const PATH = process.env.PATH; const PATH = process.env.PATH;
const INSTALL_PATH = '/opt/nix';
const CERTS_PATH = home + '/.nix-profile/etc/ssl/certs/ca-bundle.crt'; const CERTS_PATH = home + '/.nix-profile/etc/ssl/certs/ca-bundle.crt';
// Workaround a segfault: https://github.com/NixOS/nix/issues/2733 // 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 // Catalina workaround https://github.com/NixOS/nix/issues/2925
if (type() == "Darwin") { 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 // TODO: retry due to all the things that go wrong