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.
This commit is contained in:
@@ -65,6 +65,35 @@
|
||||
|
||||
devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; });
|
||||
formatter = forEachSystem (pkgs: pkgs.treefmt);
|
||||
packages = forEachSystem (
|
||||
pkgs:
|
||||
let
|
||||
installer = pkgs.callPackage ./python/installer/package.nix { };
|
||||
installer-nixos = pkgs.callPackage ./python/installer/package.nix { patchElf = false; };
|
||||
in
|
||||
{
|
||||
inherit installer installer-nixos;
|
||||
default = installer;
|
||||
}
|
||||
// lib.optionalAttrs (pkgs.stdenv.hostPlatform.system == "x86_64-linux") {
|
||||
iso = self.nixosConfigurations.iso.config.system.build.isoImage;
|
||||
}
|
||||
);
|
||||
apps = forEachSystem (
|
||||
pkgs:
|
||||
let
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
installer = {
|
||||
type = "app";
|
||||
program = "${self.packages.${system}.installer}/bin/nixos-installer";
|
||||
meta.description = "One-file NixOS ZFS installer.";
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit installer;
|
||||
default = installer;
|
||||
}
|
||||
);
|
||||
|
||||
nixosConfigurations = {
|
||||
bob = lib.nixosSystem {
|
||||
@@ -91,6 +120,12 @@
|
||||
];
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
};
|
||||
iso = lib.nixosSystem {
|
||||
modules = [
|
||||
./systems/iso
|
||||
];
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user