Compare commits

..

No commits in common. "1bd9fc116420db4c1156819d61df5d5312e1bbea" and "7e74ee604a7c18dda21e6a809720ad37ab5bae43" have entirely different histories.

View file

@ -60,17 +60,7 @@
'';
};
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 {
nixd = {
package = pkgs.nixd;
internalFormatter = true;
lspConfig = ''
@ -82,7 +72,25 @@
else noFormat
},
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"},
},
''}
},
},
''}
}
'';
};