Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/container-test-driver/test_driver/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,20 @@ def install_nix_if_needed(self) -> None:
return # Already installed

with self.nested("Installing Nix via nix-installer"):
nscd_active = self.systemctl("is-active nscd").returncode == 0
if nscd_active:
# Temporarily shutdown nscd due to https://github.com/DeterminateSystems/nix-installer/issues/622
# (which also appears with https://github.com/NixOS/nix-installer)
self.systemctl("stop nscd")
# Run nix-installer in multi-user mode with daemon
result = self.execute(
"/usr/local/bin/nix-installer install linux "
"--no-confirm "
"--extra-conf 'sandbox = false'",
timeout=300,
)
if nscd_active:
self.systemctl("start nscd")
if result.returncode != 0:
msg = f"Failed to install Nix: {result.stdout}"
raise Error(msg)
Expand Down