Steps to install the Nix package manager inside an Ubuntu 24.04 Incus container using the images:ubuntu/noble image:
- On the Incus host, create an Ubuntu 24.04 container:
lxc init images:ubuntu/noble container1 - On the Incus host, enable nested security on the container:
incus config set container1 security.nesting true - Start the container:
incus start container1 - Inside the container, install packages curl, gnupg2, man, rsync, and xz-utils:
incus exec container1 -- apt install --yes curl gnupg2 man-db rsync xz-utils - Inside the container, install Nix as user ubuntu because root may not perform a single-user Nix installation:
incus exec $container -- sudo --user ubuntu --login sh -c "curl --location --silent https://nixos.org/nix/install | sh"
One could add
xz-utilsto theinstalljob for Ubuntu 22.04 hosts.