@@ -108,10 +108,19 @@
108 # buildEnv only *symlinks* paths (never runs them), so build it
108 # buildEnv only *symlinks* paths (never runs them), so build it
109 # on the host arch — the tree is arch-neutral and links the
109 # on the host arch — the tree is arch-neutral and links the
110 # (substituted) Linux store paths, sparing the Linux builder.
110 # (substituted) Linux store paths, sparing the Linux builder.
112+ # Nix itself (+ CA certs) is always shipped, so every container
113+ # can use Nix; `initializeNixDatabase` registers the baked store.
111 copyToRoot = pkgsHost.buildEnv {
114 copyToRoot = pkgsHost.buildEnv {
112 name = "root";
115 name = "root";
113− paths = pkgList;
116+ paths = pkgList ++ [
114− pathsToLink = [ "/bin" ];
120+ pathsToLink = [
117 initializeNixDatabase = true;
126 initializeNixDatabase = true;
@@ -127,6 +136,10 @@
127 "HOME=/root"
136 "HOME=/root"
128 # Marker so shells/scripts can detect they're in here.
137 # Marker so shells/scripts can detect they're in here.
129 "NIX_CONTAINER=1"
138 "NIX_CONTAINER=1"
139+ # Make the bundled Nix usable: TLS for substituters/flakes,
140+ # flake commands on, and single-user (no daemon/nixbld).
141+ "NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"
142+ "NIX_CONFIG=experimental-features = nix-command flakes\nbuild-users-group =\nsandbox = false"