oxalica / nil

NIx Language server, an incremental analysis assistant for writing in Nix.
Apache License 2.0
1.38k stars 40 forks source link

Fail to resolve `flake.lock` when `inputs.something.follows = ""` #71

Closed ykis-0-0 closed 1 year ago

ykis-0-0 commented 1 year ago

I have a flake with a strange dependency that references to itself, which make nil reports:

ERROR nil::server: Failed to load flake workspace: Failed to resolve flake inputs from lock file: Flake input "secret-wrapper" is not locked

However, it does work (as I expected, referencing the flake itself) in nix build, nix flake update, and nix flake metadata

The flake.nix excerpt is something like this:

{
  description = "System Configuration(s)";

  inputs = {
    nixos.url = "github:NixOS/nixpkgs/nixos-unstable";
    # ...
    secret-wrapper.follows = "";
  };

  outputs = { self, secret-wrapper ? null, ... }@inputs: {
    # ...
  };
}

And the flake.lock excerpt:

{
  "nodes": {
    /* ... */
    "root": {
      "inputs": {
        "nixos": "nixos",
        "secret-wrapper": [],
        /* ... */
      }
    },
  /* ... */
}

Finally, thanks for making nil! It's a powerful LSP which helped me a lot! 👍