mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-10-03 15:33:30 +00:00
nix: fix nixd option
This commit is contained in:
parent
7e74ee604a
commit
96e1004e55
1 changed files with 12 additions and 20 deletions
|
@ -60,7 +60,17 @@
|
|||
'';
|
||||
};
|
||||
|
||||
nixd = {
|
||||
nixd = let
|
||||
settings.nixd = {
|
||||
inherit (cfg.lsp) options;
|
||||
formatting.command =
|
||||
if !cfg.format.enable
|
||||
then null
|
||||
else if cfg.format.type == "alejandra"
|
||||
then ["${cfg.format.package}/bin/alejandra" "--quiet"]
|
||||
else ["${cfg.format.package}/bin/nixfmt"];
|
||||
};
|
||||
in {
|
||||
package = pkgs.nixd;
|
||||
internalFormatter = true;
|
||||
lspConfig = ''
|
||||
|
@ -72,25 +82,7 @@
|
|||
else noFormat
|
||||
},
|
||||
cmd = ${packageToCmd cfg.lsp.package "nixd"},
|
||||
options = ${toLuaObject cfg.lsp.options},
|
||||
${optionalString cfg.format.enable ''
|
||||
settings = {
|
||||
nixd = {
|
||||
${optionalString (cfg.format.type == "alejandra")
|
||||
''
|
||||
formatting = {
|
||||
command = {"${cfg.format.package}/bin/alejandra", "--quiet"},
|
||||
},
|
||||
''}
|
||||
${optionalString (cfg.format.type == "nixfmt")
|
||||
''
|
||||
formatting = {
|
||||
command = {"${cfg.format.package}/bin/nixfmt"},
|
||||
},
|
||||
''}
|
||||
},
|
||||
},
|
||||
''}
|
||||
settings = ${toLuaObject settings},
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue