Skip to content

Commit

Permalink
conform: disable nix fmt on nixpkgs
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Nov 9, 2023
1 parent 0396059 commit de5cd1f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lua/lang/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 113,20 @@ register("stevearc/conform.nvim", {
args = { "fmt", "$FILENAME" },
stdin = false,
condition = function()
vim.fn.system({ "nix", "flake", "metadata" })
return vim.v.shell_error == 0
local output = vim.fn.system({ "nix", "flake", "metadata", "--json" })
if vim.v.shell_error ~= 0 then
return false
end

local j = vim.json.decode(output)
if
j["description"]
and j["description"] == "A collection of packages for the Nix package manager"
then
return false
end

return true
end,
},
},
Expand Down

0 comments on commit de5cd1f

Please sign in to comment.