nix
nix copied to clipboard
Attribute already defined when using function for it's definition
I couldn't find this documented anywhere, although it seems like reasonable compromise in implementation.
nix-repl> {a = ({} // {}); a.b = {};}
error: attribute 'a.b' already defined at (string):1:2
at «string»:1:18:
1| {a = ({} // {}); a.b = {};}
| ^
2|
I find this behavior annoying, especially when using custom functions for configuration like this
{
xdg.configFile = generateTSConfigs [ ... ];
xdg.configFile."nvim/init.lua".source = ...;
}
I marked this as stale due to inactivity. → More info
same issue, do you have any solution about this?
This should work, but perhaps there is a more elegant solution
{
xdg.configFile = (generateTSConfigs [ ... ] // { "nvim/init.lua".source = ... });
}