Compare commits

...

2 commits

Author SHA1 Message Date
raf
1bd9fc1164
Merge pull request #1146 from horriblename/fix-nixd-options
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Treewide Checks / Validate flake (push) Has been cancelled
Treewide Checks / Check formatting (push) Has been cancelled
Treewide Checks / Check source tree for typos (push) Has been cancelled
Treewide Checks / Validate documentation builds (push) Has been cancelled
Treewide Checks / Validate hyperlinks in documentation sources (push) Has been cancelled
Treewide Checks / Validate Editorconfig conformance (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
nix: fix nixd option
2025-09-15 19:51:11 +03:00
Ching Pei Yang
96e1004e55
nix: fix nixd option 2025-09-15 18:44:30 +02:00

View file

@ -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},
}
'';
};