nixos/installer: Refresh against upstream
The ISO target had drifted from nixpkgs and no longer evaluated: `iso-image.nix` now defines `image.baseName` itself, which conflicts with ours, so force it. Drop the `boot.initrd.systemd.enable = false` override from the `asISO` build target. The missing `/dev/root` it worked around is no longer an issue, and scripted initrd is deprecated for removal in 26.11. Replace the wpa_supplicant stanza, which upstream's `installation-device.nix` no longer carries, with NetworkManager. Keep it out of `multi-user.target` so nothing network-related starts until asked; NetworkManager enables wpa_supplicant as its backend, which is D-Bus activated on demand. Pick up three more bits from that profile: the installer `variant_id`, the pstore drop-in that stops an install evacuating the target's persistent entries, and the mdadm `PROGRAM` stub that silences the unset-mail warning. Built and booted as an ISO to confirm. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,8 +24,11 @@ The custom NixOS installer image used to bootstrap new boxes.
|
|||||||
`installer-<hex>` hostname is set at boot.
|
`installer-<hex>` hostname is set at boot.
|
||||||
- `INSTALL_ROOT=/mnt` in the session environment, plus a `show-hw-config` alias wrapping
|
- `INSTALL_ROOT=/mnt` in the session environment, plus a `show-hw-config` alias wrapping
|
||||||
`nixos-generate-config --show-hardware-config --root $INSTALL_ROOT`.
|
`nixos-generate-config --show-hardware-config --root $INSTALL_ROOT`.
|
||||||
- NixOS documentation enabled, `wpa_supplicant` available but not started, GC and memory-overcommit
|
- NixOS documentation enabled, NetworkManager available but not started at boot (run
|
||||||
tuning for low-memory targets, LVM thin and NFS support.
|
`systemctl start NetworkManager`, then `nmtui`), GC and memory-overcommit tuning for low-memory
|
||||||
|
targets, LVM thin and NFS support.
|
||||||
|
- Identifies itself as `VARIANT_ID=installer` in `/etc/os-release`, and leaves the target's
|
||||||
|
persistent pstore entries alone (`Unlink=no`) so an install doesn't evacuate them.
|
||||||
- No regular user (`my.user.enable = false`), no tmpfs-root management, no NAT, and not a
|
- No regular user (`my.user.enable = false`), no tmpfs-root management, no NAT, and not a
|
||||||
deploy target (`my.deploy.enable = false`).
|
deploy target (`my.deploy.enable = false`).
|
||||||
|
|
||||||
|
|||||||
+24
-5
@@ -32,7 +32,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
image = {
|
image = {
|
||||||
baseName = "jackos-installer";
|
baseName = mkForce "jackos-installer";
|
||||||
};
|
};
|
||||||
isoImage = {
|
isoImage = {
|
||||||
volumeID = "jackos-${config.system.nixos.release}-${pkgs.stdenv.hostPlatform.uname.processor}";
|
volumeID = "jackos-${config.system.nixos.release}-${pkgs.stdenv.hostPlatform.uname.processor}";
|
||||||
@@ -97,10 +97,17 @@
|
|||||||
documentation.enable = mkForce true;
|
documentation.enable = mkForce true;
|
||||||
documentation.nixos.enable = mkForce true;
|
documentation.nixos.enable = mkForce true;
|
||||||
|
|
||||||
# Enable wpa_supplicant, but don't start it by default.
|
system.nixos.variant_id = mkDefault "installer";
|
||||||
networking.wireless.enable = mkDefault true;
|
|
||||||
networking.wireless.userControlled = true;
|
# Enable NetworkManager, but don't start it by default.
|
||||||
systemd.services.wpa_supplicant.wantedBy = mkForce [];
|
networking.networkmanager.enable = true;
|
||||||
|
systemd.services = {
|
||||||
|
NetworkManager.wantedBy = mkForce [];
|
||||||
|
NetworkManager-wait-online.wantedBy = mkForce [];
|
||||||
|
NetworkManager-dispatcher.wantedBy = mkForce [];
|
||||||
|
# NetworkManager's wireless backend, D-Bus activated on demand
|
||||||
|
wpa_supplicant.wantedBy = mkForce [];
|
||||||
|
};
|
||||||
|
|
||||||
# Tell the Nix evaluator to garbage collect more aggressively.
|
# Tell the Nix evaluator to garbage collect more aggressively.
|
||||||
# This is desirable in memory-constrained environments that don't
|
# This is desirable in memory-constrained environments that don't
|
||||||
@@ -113,6 +120,18 @@
|
|||||||
# download-using-manifests.pl from forking even if there is
|
# download-using-manifests.pl from forking even if there is
|
||||||
# plenty of free memory.
|
# plenty of free memory.
|
||||||
boot.kernel.sysctl."vm.overcommit_memory" = "1";
|
boot.kernel.sysctl."vm.overcommit_memory" = "1";
|
||||||
|
|
||||||
|
# Prevent installation media from evacuating persistent storage, as their
|
||||||
|
# var directory is not persistent and it would thus result in deletion of
|
||||||
|
# those entries.
|
||||||
|
environment.etc."systemd/pstore.conf".text = ''
|
||||||
|
[PStore]
|
||||||
|
Unlink=no
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Remove warning about unset mail
|
||||||
|
boot.swraid.mdadmConf = "PROGRAM ${pkgs.coreutils}/bin/true";
|
||||||
|
|
||||||
services.lvm.boot.thin.enable = true;
|
services.lvm.boot.thin.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ let
|
|||||||
"${modulesPath}/installer/cd-dvd/iso-image.nix"
|
"${modulesPath}/installer/cd-dvd/iso-image.nix"
|
||||||
allHardware
|
allHardware
|
||||||
{
|
{
|
||||||
# Doesn't work right now... (missing /dev/root)
|
|
||||||
boot.initrd.systemd.enable = false;
|
|
||||||
|
|
||||||
isoImage = {
|
isoImage = {
|
||||||
makeEfiBootable = true;
|
makeEfiBootable = true;
|
||||||
makeUsbBootable = true;
|
makeUsbBootable = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user