oxalica / nil

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

Better handling of the formatter #128

Open thefossguy opened 5 months ago

thefossguy commented 5 months ago

I'm not sure what title should be given to this issue but I'm facing a unique (so far) issue. I don't have nixpkgs-fmt installed "system-wide". Instead, with home-manager, I do something like this:

programs.neovim.extraPackages = with pkgs; [
    nixpkgs-fmt
    # many more pkgs, obviously
];

Mainly because these are only needed for a nice Neovim experience and therefore, I don't want them in my $PATH. As a result, format on save with this config doesn't work for me. Unsurprisingly, !nixpkgs-fmt % works.

Is there a workaround or do I need to have nixpkgs-fmt in $PATH?

thefossguy commented 5 months ago

Possible duplicate of #123?