Can't fetch NixOS image

I can see nixos in the “Currently available images” list at https://images.linuxcontainers.org/ but if I try to do:

# lxc image list images: nix

I get back empty table. I can list other images like debian without any issues. I feel like I’m missing something basic here. :sweat_smile:

I’ve noticed pretty recent discussion here that suggests these images might not be available yet unless they were added recently. But I see the builds in Jenkins and nixos in the above mentioned list.

I am able to list the nixos images, inspect and launch them.

─❯ incus image show images:nixos/23.11
auto_update: false
properties:
  architecture: amd64
  description: Nixos 23.11 amd64 (20231216_01:00)
  os: Nixos
  release: "23.11"
  requirements.privileged: "false"
  serial: "20231216_01:00"
  type: squashfs
  variant: default
public: true
expires_at: 1970-01-01T00:00:00Z
profiles: []

~ 
─❯ incus image show images:nixos/unstable
auto_update: false
properties:
  architecture: amd64
  description: Nixos unstable amd64 (20231216_01:00)
  os: Nixos
  release: unstable
  requirements.privileged: "false"
  serial: "20231216_01:00"
  type: squashfs
  variant: default
public: true
expires_at: 1970-01-01T00:00:00Z
profiles: []

Hmm… I’m not sure what I could be doing wrong.

The remote looks correct:

$ lxc remote list  | head -n5
+----------------------+---------------------------------------------------+---------------+-------------+--------+--------+--------+
|         NAME         |                        URL                        |   PROTOCOL    |  AUTH TYPE  | PUBLIC | STATIC | GLOBAL |
+----------------------+---------------------------------------------------+---------------+-------------+--------+--------+--------+
| images               | https://images.linuxcontainers.org                | simplestreams | none        | YES    | NO     | NO     |
+----------------------+---------------------------------------------------+---------------+-------------+--------+--------+--------+

Yet if I try to list the image:

$ lxc image show  images:nixos/23.11
Error: Failed getting image: The requested image couldn't be found

I’m not using some super old version of LXD either:

$ lxc version
Client version: 5.19
Server version: 5.19

I assume this is not incus-only image or something like that?

As the NixOS image were only very recently added and were only ever developed and tested on Incus, they are not being presented to LXD users.

1 Like

That explains it I guess. Any ETA for providing this to LXD users or any workaround I could use to use these images?

Given the recent developments around LXD, effectively the fact that Canonical is making it impossible for us to collaborate with LXD or even pull any of their bugfixes, it seems unlikely that we would want to increase the number of images we provide to LXD users moving forward.

Given a system with nix installed and a checkout of nixpkgs, you can build and import nixos images.

Here’s a script I use, just replace incus with lxc and run it in the nixpkgs checkout.

Thank you. That’s helpful. I ended up using hydra-built LXD image as a starting point. I might get to building my own image instead.

I was just hoping to quickly try a bunch of stuff using NixOS from the upstream repo like I do for the other distributions. But importing custom image is not that much extra work either.

Yep those Hydra builds are the same. Also the same as what is being published to the image server.