nixos-container lets systemd-nspawn container share host’s nix store. which is really useful for deduplicating common packages among containers and host. Inspired by that, I wrote a tool bringing the “shared nix store” concept to incus. Now, we can run inx-container create <container-name> --flake <flakeref> to create a light-weight, fully functional nixos container managed by incus.
Currently, inx-container is a simple and crude shell script. And it does not offer the “purity” that containers option provides. You still need to call incus imperatively to configure network device or mount additional directories. More detail can be found in repo’s README. ![]()
BTW, cuz incus is also a virtual machine manager, we chould bring the shared store to nixos vm as well. But setting up unix socket forwarding is radically different between container and vm. I dug through incus and qemu documentation, sadly to find no direct method to passthrough a unix socket to vm. I tried with ssh socket forwarding, although it works, it is not a “one click” setup. So I decided not bringing it in for now.
Any idea is welcome!