Skip to content

Add support for multiple NixOS system profiles#541

Open
leguteape wants to merge 3 commits into
nix-community:masterfrom
leguteape:master
Open

Add support for multiple NixOS system profiles#541
leguteape wants to merge 3 commits into
nix-community:masterfrom
leguteape:master

Conversation

@leguteape
Copy link
Copy Markdown

Hey everyone. This PR attempts to add support for NixOS system profiles to lanzaboote. I had originally written this patch at around August of 2025 for personal use but the folks over at #135 have encouraged me to create a PR here.

Here's a list of the most important changes:

  • Get profile names from system-profiles/ while also being compatible with non-profiled systems
  • Since profile names can also have - characters, handle any stray -s so versions and profile names can be safely extracted
  • Add profile names to the .efi entries as well as in boot menus in a fashion consistent with systemd-boot
  • Update the unit and integration tests to accommodate the presence and absence of profiles

I must add that I didn't know any Rust and sorta hacked my way around when I made these changes, following compiler hints and warnings. So, the quality of the my modifications may not be the best. I would, hence, be welcoming of any suggestions aimed towards improving the quality of this patch.

P.S. Here's an image of what the boot menu looks like after my changes (profile names are inside square brackets):

image
  • Entry 1 belongs to the default profile, aka the system profile.
  • Entry 2 belongs to the Workstation profile
  • Entry 3 belongs to the Gamestation profile

@RaitoBezarius
Copy link
Copy Markdown
Member

@rv32ima can I let you do a first pass? Then ping me and I will do another pass so we can get that promptly merged.

Comment thread nix/modules/lanzaboote.nix Outdated
++ cfg.extraEfiSysMountPoints;

mkInstallCommand = efiSysMountPoint: ''
prof_dir="/nix/var/nix/profiles" profiles=""
Copy link
Copy Markdown
Member

@nikstur nikstur Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should definitely not be implemented as a shell script. This needs to be done in the rust code

This comment was marked as low quality.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey. Thanks for your suggestion! I am willing to rewrite this in Rust but I would appreciate some pointers regarding where to implement this functionality. If you could suggest the file/files for storing this code, that would be quite helpful.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikstur what do you think about removing the Installer generation_links argument and generating the list of generations here?

leguteape added 3 commits May 1, 2026 10:29
- Make profile name available in bootmenu entries to aid identification
- Also add profile name to .efi files in `EFI/Linux`
- Handle cases where profile name is not specified by falling back to
`system-*-link`
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.

5 participants