Skip to content

Commit 8a3b9d1

Browse files
calamares-nixos-extension: Set build-dir during nixos-install
1 parent 6a08e6b commit 8a3b9d1

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

  • pkgs/by-name/ca/calamares-nixos-extensions/src/modules/nixos

pkgs/by-name/ca/calamares-nixos-extensions/src/modules/nixos/main.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,16 @@ def run():
797797
"nixos-install",
798798
"--no-root-passwd",
799799
"--root",
800-
root_mount_point
800+
root_mount_point,
801+
# Nix requires its build directory to have no
802+
# world-writable parent directories. The chroot store that
803+
# nixos-install uses will use the state dir in the chroot
804+
# for the build-dir, but the chroot is under /tmp, which
805+
# is writable. It doesn't have to be in the chroot though,
806+
# so we can just realign it with the host state dir.
807+
"--option",
808+
"build-dir",
809+
"/nix/var/nix/builds",
801810
]
802811
)
803812

0 commit comments

Comments
 (0)