Whats wrong? `/etc/nixos/configuration.nix' has an unsupported attribute `boot'

So, nixos modules alllow two syntaxes:

{
  imports = [ <some imports> ];
  my-favorite-option = true;
}

and

{
  imports = [ <some imports> ];
  options = { <some custom options> };
  config = {
    my-favorite-option = true;
  };
}

This can be confusing, but the latter syntax is used to define custom options, whereas the former is just used to set them. config in the latter should contain any options the module sets, and usually contains a whole bunch of conditionals so that it changes based on what is set with the options.

The way it works is that if you omit options and config, all keys will simply be treated as if they were in config.

However, if you define a config and try to set options at the same time, nix won’t be able to distinguish between these two modes, and you get the error message you have.

The reason it talks about boot is simply because it’s the first problem it encountered.

Thus, while looking for boot is nice and all, I really need to see your full config file to se where you went wrong. You probably added an options or config somewhere :slight_smile:

9 Likes