{ 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."; }