I’m trying to write my first NixOS module, and I’m getting an error I just can’t seem to figure out. Here is the text of the module: https://github.com/NixOS/nixpkgs/blob/03cde75ae110069555584e9bb9e3d9887f2d6530/nixos/modules/misc/wordlist.nix
When I try to set:
config.environment.wordlist = {
enable = true;
lists = [
{
envVar = "AUGMENTED_WORDLIST";
source = [
{ file = "${pkgs.scowl}/share/dict/words.txt"; }
{ words = [ "foo" "bar" "baz" ]; }
];
}
];
};
I’m getting an error that I just don’t understand:
error: value is a function while a set was expected
at /nix/store/nd91gpdz8wf7y82a55v7l3sj0lqdrmaz-source/lib/types.nix:617:32:
616| description = "${t1.description} or ${t2.description}";
617| check = x: t1.check x || t2.check x;
| ^
618| merge = loc: defs:
Full trace is available here: error: value is a function while a set was expected at /nix/store/nd91 - Pastebin.com
I just don’t understand exactly what is triggering this, and my attempts to debug this issue have been thwarted by trace
being seemingly inconsistent, I assume due to laziness, (though it is highly mysterious to me exactly why/how this works, for instance if I add trace x
on line 110, I get { envVar = <CODE>; source = <CODE> }
, and if I trace x.envVar
I get AUGMENTED_WORDLIST
but if I trace x.source
I get nothing at all.)
Does anyone have any tips or recommendations?