mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-03-11 03:06:01 +00:00
Compare commits
No commits in common. "1bd9fc116420db4c1156819d61df5d5312e1bbea" and "7e74ee604a7c18dda21e6a809720ad37ab5bae43" have entirely different histories.
1bd9fc1164
...
7e74ee604a
1 changed files with 20 additions and 12 deletions
|
|
@ -60,17 +60,7 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
nixd = let
|
nixd = {
|
||||||
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;
|
package = pkgs.nixd;
|
||||||
internalFormatter = true;
|
internalFormatter = true;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
|
|
@ -82,7 +72,25 @@
|
||||||
else noFormat
|
else noFormat
|
||||||
},
|
},
|
||||||
cmd = ${packageToCmd cfg.lsp.package "nixd"},
|
cmd = ${packageToCmd cfg.lsp.package "nixd"},
|
||||||
settings = ${toLuaObject settings},
|
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"},
|
||||||
|
},
|
||||||
|
''}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
''}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue