Nixd completion inside flake-parts modules

Right now I’m using the dendritic pattern for my NixOS configuration, so most of my configuration is not sitting at the top level but rather inside of flake-parts modules (e.g., under flake.modules.nixos.base).

The problem I’m running into is that I’m not getting any settings completions with nixd unless the module is a lambda, e.g.,

{
  flake.modules.nixos.no-lambda = {
    # no completion here
    |
  };

  flake.modules.nixos.with-lambda = {pkgs, ...}: {
    # completion works here
    |
  };
}

Is there a way I can get nixd to provide completion inside any flake-parts module, basically just inside anything that sits two levels down from flake.modules (without workarounds like using dummy {…}: lambdas)? I don’t see nixd providing any options to customize what locations should be treated as “top level”.

3 Likes