Inx-container: Run nixos container on nixos host with shared nix store using incus

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. :slight_smile:


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!

3 Likes

It is supposed to go under announcement category. But I somehow cannot create topic there. Could someone help?

I could, as being TL3 I can recategorize, but you wouldn’t be able to reply:

I could move this under Links though, if you want. :wink:

Thanks, but let me try again tomorrow.

1 Like

I see. My TL is basic user. I registered yesterday to write this post :joy:. I have moved it to Links, where I have permission.

1 Like

thanks. i tried porting this to my opentofu-based deployments to incus, and it seems to be working. pretty happy.

2 Likes