Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,11 @@ neovim-dev: ## Set up local Neovim development environment.
rm "$(HOME)/.config/nvim"; \
fi
@mkdir -p "$(HOME)/.config/nvim"
@if [ -L "$(HOME)/.config/nvim/lua" ] || [ -d "$(HOME)/.config/nvim/lua" ]; then \
rm -rf "$(HOME)/.config/nvim/lua"; \

@cubic-dev-ai cubic-dev-ai Bot Mar 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: lua-check-neovim now deletes and replaces the user's real ~/.config/nvim/lua tree, so a validation command becomes destructive.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Makefile, line 606:

<comment>`lua-check-neovim` now deletes and replaces the user's real `~/.config/nvim/lua` tree, so a validation command becomes destructive.</comment>

<file context>
@@ -602,7 +602,11 @@ neovim-dev: ## Set up local Neovim development environment.
 	fi
 	@mkdir -p "$(HOME)/.config/nvim"
+	@if [ -L "$(HOME)/.config/nvim/lua" ] || [ -d "$(HOME)/.config/nvim/lua" ]; then \
+		rm -rf "$(HOME)/.config/nvim/lua"; \
+	fi
 	@ln -sf "$(PWD)/home-manager/programs/neovim/init.lua" "$(HOME)/.config/nvim/init.lua"
</file context>
Fix with Cubic

fi
Comment on lines +605 to +607

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This if block can be simplified. rm -rf is idempotent and will not error if the path doesn't exist, and it correctly handles files, directories, and symlinks. Replacing this block with a single command improves readability.

Additionally, the rm command on line 606 was missing an @ prefix, which would cause it to be printed during execution. The suggested change fixes this as well.

	@rm -rf "$(HOME)/.config/nvim/lua"

Comment on lines +605 to +607
@ln -sf "$(PWD)/home-manager/programs/neovim/init.lua" "$(HOME)/.config/nvim/init.lua"
@ln -sf "$(PWD)/home-manager/programs/neovim/lua" "$(HOME)/.config/nvim/lua"
@ln -sf "$(PWD)/home-manager/programs/neovim/nvim-pack-lock.json" "$(HOME)/.config/nvim/nvim-pack-lock.json"
@echo "✅ Local Neovim development environment ready"
@echo "🚧 To restore the Nix-managed version, run 'make switch'"
Expand All @@ -611,7 +615,11 @@ neovim-dev: ## Set up local Neovim development environment.
neovim-upgrade: ## Update Neovim plugins.
@echo "📦 Updating neovim plugins..."
@mkdir -p ~/.config/nvim
@if [ -L "$(HOME)/.config/nvim/lua" ] || [ -d "$(HOME)/.config/nvim/lua" ]; then \
rm -rf "$(HOME)/.config/nvim/lua"; \
fi
Comment on lines +618 to +620
@ln -sf "$(PWD)/home-manager/programs/neovim/init.lua" ~/.config/nvim/init.lua
@ln -sf "$(PWD)/home-manager/programs/neovim/lua" ~/.config/nvim/lua

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency and better reliability in Makefiles, it's recommended to use $(HOME) instead of ~. The if block you added just above uses $(HOME), and it's a good practice to follow throughout the file to avoid unexpected shell expansion issues.

	@ln -sf "$(PWD)/home-manager/programs/neovim/lua" "$(HOME)/.config/nvim/lua"

@cubic-dev-ai cubic-dev-ai Bot Mar 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Inconsistent use of ~ vs $(HOME) within the same target. The if block above uses $(HOME) but this new ln command uses ~. Use $(HOME) consistently for reliability — tilde expansion in Makefiles depends on the shell and can fail in certain quoting contexts.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Makefile, line 622:

<comment>Inconsistent use of `~` vs `$(HOME)` within the same target. The `if` block above uses `$(HOME)` but this new `ln` command uses `~`. Use `$(HOME)` consistently for reliability — tilde expansion in Makefiles depends on the shell and can fail in certain quoting contexts.</comment>

<file context>
@@ -611,7 +615,11 @@ neovim-dev: ## Set up local Neovim development environment.
+		rm -rf "$(HOME)/.config/nvim/lua"; \
+	fi
 	@ln -sf "$(PWD)/home-manager/programs/neovim/init.lua" ~/.config/nvim/init.lua
+	@ln -sf "$(PWD)/home-manager/programs/neovim/lua" ~/.config/nvim/lua
 	@ln -sf "$(PWD)/home-manager/programs/neovim/nvim-pack-lock.json" ~/.config/nvim/nvim-pack-lock.json
 	@nvim --headless +"lua vim.pack.update()" +qa
</file context>
Suggested change
@ln -sf "$(PWD)/home-manager/programs/neovim/lua" ~/.config/nvim/lua
@ln -sf "$(PWD)/home-manager/programs/neovim/lua" "$(HOME)/.config/nvim/lua"
Fix with Cubic

@ln -sf "$(PWD)/home-manager/programs/neovim/nvim-pack-lock.json" ~/.config/nvim/nvim-pack-lock.json
@nvim --headless +"lua vim.pack.update()" +qa
@echo "✅ Neovim plugins updated"
Expand Down Expand Up @@ -653,7 +661,11 @@ lua-check-neovim: ## Check Neovim configuration.
fi
@echo "📝 Validating Neovim configuration syntax..."
@mkdir -p ~/.config/nvim
@if [ -L "$(HOME)/.config/nvim/lua" ] || [ -d "$(HOME)/.config/nvim/lua" ]; then \
rm -rf "$(HOME)/.config/nvim/lua"; \
Comment on lines +664 to +665
fi
@ln -sf "$(PWD)/home-manager/programs/neovim/init.lua" ~/.config/nvim/init.lua
@ln -sf "$(PWD)/home-manager/programs/neovim/lua" ~/.config/nvim/lua

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency and better reliability in Makefiles, it's recommended to use $(HOME) instead of ~. Using $(HOME) consistently avoids potential issues with shell expansion.

	@ln -sf "$(PWD)/home-manager/programs/neovim/lua" "$(HOME)/.config/nvim/lua"

@if [ -f "$(PWD)/home-manager/programs/neovim/nvim-pack-lock.json" ]; then \
ln -sf "$(PWD)/home-manager/programs/neovim/nvim-pack-lock.json" ~/.config/nvim/nvim-pack-lock.json; \
fi
Expand Down
8 changes: 4 additions & 4 deletions home-manager/programs/neovim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ local function append_package_path(path)
end
end

local config_lua_path = vim.fn.stdpath("config") .. "/lua/?.lua"
append_package_path(config_lua_path)
append_package_path(vim.fn.stdpath("config") .. "/lua/?/init.lua")

local init_source = debug.getinfo(1, "S").source
if init_source:sub(1, 1) == "@" then
init_source = init_source:sub(2)
Expand All @@ -26,6 +22,10 @@ local init_dir = vim.fn.fnamemodify(init_path, ":h")
append_package_path(init_dir .. "/lua/?.lua")
append_package_path(init_dir .. "/lua/?/init.lua")

local config_lua_path = vim.fn.stdpath("config") .. "/lua/?.lua"
append_package_path(config_lua_path)
append_package_path(vim.fn.stdpath("config") .. "/lua/?/init.lua")

-- ====================================================================================
-- MODULES
-- ====================================================================================
Expand Down
1 change: 0 additions & 1 deletion home-manager/programs/neovim/lua/config/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ vim.pack.add({
{ src = "https://github.com/kylechui/nvim-surround" },
{ src = "https://github.com/folke/todo-comments.nvim" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter-context" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects" },
{ src = "https://github.com/RRethy/nvim-treesitter-endwise" },

-- LSP
Expand Down
53 changes: 0 additions & 53 deletions home-manager/programs/neovim/lua/config/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,57 +108,4 @@ require("nvim-treesitter.config").setup({
},
},
auto_install = true,
textobjects = {
enable = true,
lookahead = true,
swap = {
enable = true,
swap_next = {
["<leader>a"] = "@parameter.inner",
},
swap_previous = {
["<leader>A"] = "@parameter.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]f"] = "@function.inner",
["]c"] = "@class.inner",
["]a"] = "@parameter.inner",
},
goto_next_end = {
["]F"] = "@function.inner",
["]C"] = "@class.inner",
["]A"] = "@parameter.inner",
},
goto_previous_start = {
["[f"] = "@function.inner",
["[c"] = "@class.inner",
["[a"] = "@parameter.inner",
},
goto_previous_end = {
["[F"] = "@function.inner",
["[C"] = "@class.inner",
["[A"] = "@parameter.inner",
},
},
select = {
enable = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",

["ac"] = "@conditional.outer",
["ic"] = "@conditional.inner",

["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",

["av"] = "@variable.outer",
["iv"] = "@variable.inner",
},
},
},
})
2 changes: 1 addition & 1 deletion named-hosts/matic/falcon.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ in
serviceConfig = {
Type = "forking";
PIDFile = "/run/falcond.pid";
ExecStartPre = initScript;
ExecStartPre = "${pkgs.bash}/bin/bash ${initScript}";
ExecStart = "${falcon}/bin/fs-bash -c \"/opt/CrowdStrike/falcond\"";

Restart = "on-failure";
Expand Down
Loading