Files
dotfiles/python/installer/package.nix
T
Richie b252b0bf6e feat(installer): add one-file installer build and custom install ISO
Replace old_installer.py with a curses TUI installer packaged as a
one-file PyInstaller binary (python/installer/build.py, wrapped by
python/installer/package.nix). The default .#installer is patched to run
on foreign Linux live media; the new .#installer-nixos variant keeps its
Nix store interpreter so it runs on NixOS.

Add systems/iso, a minimal NixOS install CD with kernel 6.18 and ZFS 2.4
matching the deployed systems and the installer on PATH; build it with
nix build .#iso. Shared logging and subprocess helpers move out of
common.py into python/logging_config.py and python/process.py.
2026-07-02 14:17:49 -04:00

50 lines
1000 B
Nix

{
lib,
stdenv,
patchelf,
python314,
python314Packages,
patchElf ? true,
}:
stdenv.mkDerivation {
pname = "nixos-installer";
version = "0.1.0";
src = ../../.;
dontPatchELF = true;
dontStrip = true;
nativeBuildInputs = [
patchelf
python314
python314Packages.pyinstaller
];
buildPhase = ''
runHook preBuild
export HOME="$TMPDIR"
python "$src/python/installer/build.py" \
--source-root "$src" \
--build-root "$TMPDIR/nixos-installer-build" \
--output "$PWD/nixos-installer" ${lib.optionalString (!patchElf) "--skip-patchelf"}
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 nixos-installer $out/bin/nixos-installer
runHook postInstall
'';
meta.description =
if patchElf then
"One-file NixOS ZFS installer patched to run on foreign Linux live environments."
else
"One-file NixOS ZFS installer linked against the Nix store, for the custom install ISO.";
}