Skip to content

Autocompletion and Diagnostics for self #790

@Ryokune

Description

@Ryokune

Is your feature request related to a problem? Please describe.
Would be nice to have. Currently, I maintain a flake that uses flake parts and import tree, and I access imports via self.nixosModules.foo self.nixosModules.myService etc.
Ex:

... modules/hosts/myHost:
flake.nixosConfigurations.myHost = inputs.nixpkgs.lib.nixosSystem {
  modules = [
    self.nixosModules.someModule
  ]
}

... flake.nix:
outputs =
    inputs@{ self, ... }:
    inputs.flake-parts.lib.mkFlake { inherit inputs; } {
      imports = [
        (inputs.import-tree ./modules)
      ];
      debug = true;
    };

Currently by how things are I could mistype something, or access an invalid attribute eg: self.invalid.module and nixd won't catch it via diagnostics. But i am unsure if this is just a misconfiguration on my end.

Additional context
Using hercules-ci:flake-parts and vic:import-tree in a project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions