mirror of
https://codeberg.org/icewind/attic-action.git
synced 2026-06-03 17:44:07 +02:00
Allow Nix to be installed in single-user mode
(cherry picked from commit 476599180e7c5d616cb06a852a564bd56298e468) Signed-off-by: Domen Kožar <domen@dev.si>
This commit is contained in:
parent
a174b4716e
commit
76bd1745d3
2 changed files with 8 additions and 4 deletions
|
|
@ -61,13 +61,15 @@ function run() {
|
|||
// enable post-build-hook
|
||||
yield exec.exec("sudo", ["sh", "-c", `echo post-build-hook = /etc/nix/cachix-push.sh >> /etc/nix/nix.conf`]);
|
||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
||||
// Ignore reloading failures as Nix might be installed in single-user mode (install-nix-action version 5 or lower)
|
||||
const options = { ignoreReturnCode: true };
|
||||
// Reload nix-daemon
|
||||
if (os_1.type() == "Darwin") {
|
||||
// kickstart awaits nix-daemon to get up again
|
||||
yield exec.exec("sudo", ["launchctl", "kickstart", "-k", "system/org.nixos.nix-daemon"]);
|
||||
yield exec.exec("sudo", ["launchctl", "kickstart", "-k", "system/org.nixos.nix-daemon"], options);
|
||||
}
|
||||
else {
|
||||
yield exec.exec("sudo", ["pkill", "-HUP", "nix-daemon"]);
|
||||
yield exec.exec("sudo", ["pkill", "-HUP", "nix-daemon"], options);
|
||||
}
|
||||
core.endGroup();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,12 +48,14 @@ async function run() {
|
|||
await exec.exec("sudo", ["sh", "-c", `echo post-build-hook = /etc/nix/cachix-push.sh >> /etc/nix/nix.conf`]);
|
||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
||||
|
||||
// Ignore reloading failures as Nix might be installed in single-user mode (install-nix-action version 5 or lower)
|
||||
const options = { ignoreReturnCode: true };
|
||||
// Reload nix-daemon
|
||||
if (type() == "Darwin") {
|
||||
// kickstart awaits nix-daemon to get up again
|
||||
await exec.exec("sudo", ["launchctl", "kickstart", "-k", "system/org.nixos.nix-daemon"]);
|
||||
await exec.exec("sudo", ["launchctl", "kickstart", "-k", "system/org.nixos.nix-daemon"], options);
|
||||
} else {
|
||||
await exec.exec("sudo", ["pkill", "-HUP", "nix-daemon"]);
|
||||
await exec.exec("sudo", ["pkill", "-HUP", "nix-daemon"], options);
|
||||
}
|
||||
|
||||
core.endGroup();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue