Can I use the full path of a tool with sqlformat-command?
bbigras opened this issue · comments
Bruno Bigras commented
I would like to do this with nix instead of adding sqlfluff in my path.
{
sqlformat = {
enable = true;
hook = [
"(sql-mode-hook . sqlformat-on-save-mode)"
];
config = ''
(setq sqlformat-command "${pkgs.sqlfluff}/bin/sqlfluff")
(setq sqlformat-args '("fix" "-f" "-"))
'';
};
}
Steve Purcell commented
Hey! Currently - somewhat embarrassingly - that's not possible because the executable is just found off the path. What I do personally with Nix is to have a per-project shell.nix
for tools, and then I use envrc.el
and direnv
to ensure that tools like sqlfluff
are found via the current nix environment.