From 497fed2c07ed966a1f6ed82f3722025b18b13b4c Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 6 Jun 2023 11:14:31 +0100 Subject: [PATCH] Check for nix executable rather than NixOS in uname --- lua/plugins/notify.lua | 2 +- lua/plugins/nvim_neorg.lua | 2 +- lua/plugins/treesitter.lua | 11 ++--------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua index 74e2f9c..4adb49d 100644 --- a/lua/plugins/notify.lua +++ b/lua/plugins/notify.lua @@ -6,6 +6,6 @@ return { opts = { background_colour = "#000000", fps = 60, - render = "compact", + render = "default", }, } diff --git a/lua/plugins/nvim_neorg.lua b/lua/plugins/nvim_neorg.lua index 39c645a..52e913d 100644 --- a/lua/plugins/nvim_neorg.lua +++ b/lua/plugins/nvim_neorg.lua @@ -1,6 +1,6 @@ return { "nvim-neorg/neorg", - cond = function() return string.match(vim.loop.os_uname().version, "NixOS") and not vim.g.vscode end, + cond = function() return vim.fn.executable("nix") == 1 and not vim.g.vscode end, build = ":Neorg sync-parsers", event = { "FileType norg" }, cmd = "Neorg", diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index c715782..f299331 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,17 +1,10 @@ -local dependencies -if vim.g.vscode then - dependencies = { "nvim-treesitter/nvim-treesitter-refactor" } -else - dependencies = { "nvim-treesitter/nvim-treesitter-refactor", "nvim-neorg/neorg" } -end - return { "nvim-treesitter/nvim-treesitter", - cond = function() return string.match(vim.loop.os_uname().version, "NixOS") end, + cond = function() return vim.fn.executable "nix" == 1 end, version = false, build = ":TSUpdate", event = { "BufReadPre", "BufNewFile" }, - dependencies = dependencies, + dependencies = { "nvim-treesitter/nvim-treesitter-refactor", "nvim-neorg/neorg" }, config = function(_, opts) if type(opts.ensure_installed) == "table" then -- @type table