Hi- I have an issue that is specific to the nixos 26.05 image. When I launch the image the resolv.conf does not have the incus search domain. - see below
This seems to have added incus as search domain- However, I need this to be done when the container is launched.
**************************************************************************
Hmm, that’s odd, does Nix have a different default for the DHCP settings somehow?
I’m pretty sure UseDomain=yes is the usual default on most platforms.
I think it is a problem with the image and may be an oversight. I agree with you that the default behavior should be set the search domain on the incus image which has been my experience with all other incus images.
Nixos is declarative. In the /etc/nixos/, two files get created: configuration.nix and incus.nix. I am still learning nixos and maybe these files need to be changed in the upstream image.
It is definitely an issue if you need DNS at the time the image gets created. Yes it can be manually fixed, but I am using tofu and deploy rs to configure the workload. Deploy rs relies on having SSH access to the target container and I need to initiate the SSH session with the DNS name of the target container.
Edit this configuration file to define what should be installed on your system. Help is available in the configuration.nix(5) man page and in the NixOS manual (accessible by running ‘nixos-help’).
{ modulesPath, … }:
{
imports = [
Include the default incus configuration.
“${modulesPath}/virtualisation/lxc-container.nix”
Include the container-specific autogenerated configuration.
If I were you, I would separate process of learning NixOS from Incus. What you are trying to do now is to fix your lack of understanding of NixOS with chaotic fixes taken from your previous experiences with non-declarative systems. What you need to do is to create a NixOS configuration which will suit your requirements first, run it on the default naked image you are provided by Incus, and then use NixOS deployment tools. Try to do that without Incus first, to make your learning curve less steep.
If you could edit your post with the .nix files, and put three backticks (```) on a line of their own before and after the content of each file, it will be much easier to read.
This is a markdown fenced code block - without it, contents of your file are interpreted as markdown - e.g. a comment starting with # is treated as a heading.