Skip to content

Building reproducible and immutable NixOS images. Accompanying repository for my All Systems Go 2024 talk.

License

Notifications You must be signed in to change notification settings

msanft/reproducible-immutable-nixos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building reproducible and immutable NixOS images

This is the accompanying repository for my All Systems Go 2024 talk with the same name.

Important

This repository is not meant for direct consumption via this Flake. Outputs may and will be unstable. It is rather meant as a reference for how such images may look and be built like.

As of now, only images to be booted with QEMU are built, but I'm happy to take contributions for other platforms.

What this repository wants to achieve

It should be a reference for how immutable NixOS configurations can be built, and how they can be packed into OS images reproducibly. It is very unlikely that the exact configuration presented here can be used in any real-world scenario as is. It should rather be considered a one-size-fits-most approach, and tweaked per use-case.

How to Build

# Build the GPT disk image
nix build .#qemu-image
# Verify reproducibility
nix build .#qemu-image --keep-failed --rebuild
# Boot it in QEMU
nix run .#boot-uefi-qemu -- ./result/image_0.0.1.raw

Features

  • Measured boot with UKI
  • Read-only root partition, integrity-protected by dm-verity
    • Filesystem integrity is embedded into PCR values through kernel command line (roothash=)
    • System integrity is verifiable through TPM remote attestation
  • Bootable image built with systemd-repart

Credits

About

Building reproducible and immutable NixOS images. Accompanying repository for my All Systems Go 2024 talk.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages