Skip to content

feat: add flake-parts installer image options#1223

Open
different-name wants to merge 1 commit intonix-community:masterfrom
different-name:flake-offline-installer
Open

feat: add flake-parts installer image options#1223
different-name wants to merge 1 commit intonix-community:masterfrom
different-name:flake-offline-installer

Conversation

@different-name
Copy link
Copy Markdown
Contributor

@different-name different-name commented Mar 3, 2026

Creating an offline installer configuration is already demonstrated in the disko docs, however it's pretty dense and I think a module would be a great replacement for copying that large chunk of code from the docs

This PR adds the disko-install option set to the flake-parts module, which generates installer images with dependencies & install script included

Minimal config:

disko-install.hosts = {
  my-host.disks.main = /dev/disk/by-id/some-disk-id;
};

Exhaustive config:

disko-install.hosts = {
  my-host = {
    nixosConfiguration = "my-host";
    disks.main = /dev/disk/by-id/some-disk-id;
    image = {
      formats = [ "iso-installer" "hyperv" ];
      modules = [ /*<nixos module>*/ ];
    };
    script = {
      name = "my-cool-installer";
      extraArgs = [ "--dry-run" ];
    };
  };
};

TODO

This works to generate installer images (I have tested with iso-installer) with a install-nixos-unattended script, however it still needs work:

  • Stricter typing for formats option, as it currently is just listOf str
  • Documentation
  • Tests?

@different-name different-name force-pushed the flake-offline-installer branch from 42c513a to be79162 Compare March 6, 2026 05:42
@different-name
Copy link
Copy Markdown
Contributor Author

Marking this as ready for review, since the install script is implemented & I'm happy with the way it's configured

@different-name different-name marked this pull request as ready for review March 6, 2026 05:56
@different-name different-name force-pushed the flake-offline-installer branch from be79162 to e065bac Compare March 6, 2026 07:28
@nixos-discourse
Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/offline-automated-installation-images-for-disko/75953/1

@mightyiam
Copy link
Copy Markdown
Member

How about some tests?

@different-name
Copy link
Copy Markdown
Contributor Author

Tests is on the todo above, I don't have much experience with CI, and wanted to gauge if this is something desirable before continuing with docs & tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants