Hi! I am a new NixOS user, so please inform me if the following question is irrelevant, or has an easy answer.
I am trying to understand how the imports
list works in the configuration.nix
. I can’t really find how the imports
list is used by NixOS
. I expect it to work similar to the import
function but that does not seem to be the case.
By default, the import
function does not pass any variable/environmet to the evaluated expression. However, the NixOS configuration is readily available in the expressions part of the imports
list.
So what I get is that NixOS is doing something like (I am using Haskell syntax, please excuse me)
map (\x -> import x currentSystemConfig) imports
and then merge the expression (with //
or something similar). currentSystemConfig
is the attribute set of the current configuration of NixOS containing the services.xxx
attribute set, the programs.xxx
attribute set and so on.
In any case, this is really confusing and I don’t find any documentation about the imports
list. (There is plenty of information about the import
function, which should probably be called eval
, at least in my opinion).
Thanks!