[UNMAINTAINED] lightweight NixOS images
Go to file
2021-07-02 22:50:20 +02:00
checks add git hooks 2021-07-02 21:27:24 +02:00
lib add flake-compat 2021-06-27 11:11:20 +02:00
miniguest add option to override bundled nix 2021-07-02 22:33:40 +02:00
modules copy symlinks not targets 2021-06-27 09:42:18 +02:00
templates first commit 2021-06-26 20:59:38 +02:00
.envrc add git hooks 2021-07-02 21:27:24 +02:00
.gitignore improve .gitignore 2021-07-02 21:28:49 +02:00
default.nix add nix-build compat 2021-07-02 21:27:24 +02:00
devshell.toml Add bash and nix to devshell 2021-07-02 22:50:20 +02:00
flake.lock add devShell 2021-06-27 11:11:20 +02:00
flake.nix add checks output 2021-06-27 20:05:27 +02:00
LICENSE add License 2021-06-26 22:57:36 +02:00
README.md Create README.md 2021-06-26 22:46:41 +02:00
shell.nix add flake-compat 2021-06-27 11:11:20 +02:00

Low-footprint NixOS images

This tool makes lightweight NixOS virtual machines and containers for popular virtualisation tools. The guest systems live entirely on the host's Nix store. The host system does not need to be NixOS.

How lightweight?

Lighter than if it were the host system. There is no disk image, no bootloader, no ISO. Just plain immutable file that are friendly to Nix's deduplication mechanisms.

Support Vector

Libvirt KVM guests are the current primary focus. Any hypervisor that is capable of direct-kernel boot can most likely work as well. Libvirt OS containers will come in the future.

Dependencies

  • Nix 2.4+
  • Bash 4.0+

Usage

Guest system configuration must be presented within a Nix flake, import this flake's nixosModules.miniguest module, and set boot.miniguest.enable to true. The miniguest tool can then be invoked with the name of the guest as an argument. The configuration will then be built and will appear under /etc/miniguests/«guestName». Refer to this template to create the corresponding libvirt domain.

It is recommended to create at most one domain per configuration so that they can all be rebuilt independently of each other.

  • nixos-container: Miniguest takes inspiration from NixOS's containers, however, containers wraps systemd-nspawn, whereas miniguests delegates actual guest management to any supported hypervisor.

  • nixos-rebuild build-vm: Miniguest borrows the store-sharing mechanism from NixOS's built-in lightweight QEMU VMs when applicable, but it lets libvirt take care of the VM configuration and lifecycle.