Compare commits

..

6 commits

Author SHA1 Message Date
RingOfStorms (Joshua Bell)
26dd42aebb disable sshfs 2025-10-27 22:20:45 -05:00
RingOfStorms (Joshua Bell)
5d2bc9abb8 idk 2025-10-27 21:57:13 -05:00
RingOfStorms (Joshua Bell)
5f4f5a9997 Merge branch 'minified' of ssh://git.joshuabell.xyz:3032/ringofstorms/nvim into minified 2025-10-27 21:53:45 -05:00
RingOfStorms (Joshua Bell)
8a0dd46473 more 2025-10-27 21:53:43 -05:00
RingOfStorms (Joshua Bell)
a510ccafb6 update config version and remove unused 2025-10-27 21:49:50 -05:00
RingOfStorms (Joshua Bell)
d5b6a69f9a minified test 2025-10-27 21:23:43 -05:00
10 changed files with 101 additions and 144 deletions

29
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1761605067, "lastModified": 1761619080,
"narHash": "sha256-XlXxfbRET+JrBLnnknmlO6rEazTe/S4Nycnkls6Oe0Q=", "narHash": "sha256-PsLFmU/CORWeCjJi9ALsegwr/SMjf2gHsooTR09az4c=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8929c5ea8ff351a777bc983b0b8e0a46587e6909", "rev": "fd644bba1d3a83169e4b312ce20928ba1b0abb02",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -495,22 +495,6 @@
"type": "github" "type": "github"
} }
}, },
"nvim_plugin-nosduco/remote-sshfs.nvim": {
"flake": false,
"locked": {
"lastModified": 1759193354,
"narHash": "sha256-FfUxpRfqrf0r56/gi76N2ZooWnXWO0aRtaQBS7m+SvY=",
"owner": "nosduco",
"repo": "remote-sshfs.nvim",
"rev": "45502b3892774811153aeab5f7f9b0033c82005c",
"type": "github"
},
"original": {
"owner": "nosduco",
"repo": "remote-sshfs.nvim",
"type": "github"
}
},
"nvim_plugin-numToStr/Comment.nvim": { "nvim_plugin-numToStr/Comment.nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -928,7 +912,6 @@
"nvim_plugin-mfussenegger/nvim-lint": "nvim_plugin-mfussenegger/nvim-lint", "nvim_plugin-mfussenegger/nvim-lint": "nvim_plugin-mfussenegger/nvim-lint",
"nvim_plugin-mrcjkb/rustaceanvim": "nvim_plugin-mrcjkb/rustaceanvim", "nvim_plugin-mrcjkb/rustaceanvim": "nvim_plugin-mrcjkb/rustaceanvim",
"nvim_plugin-neovim/nvim-lspconfig": "nvim_plugin-neovim/nvim-lspconfig", "nvim_plugin-neovim/nvim-lspconfig": "nvim_plugin-neovim/nvim-lspconfig",
"nvim_plugin-nosduco/remote-sshfs.nvim": "nvim_plugin-nosduco/remote-sshfs.nvim",
"nvim_plugin-numToStr/Comment.nvim": "nvim_plugin-numToStr/Comment.nvim", "nvim_plugin-numToStr/Comment.nvim": "nvim_plugin-numToStr/Comment.nvim",
"nvim_plugin-nvim-lua/plenary.nvim": "nvim_plugin-nvim-lua/plenary.nvim", "nvim_plugin-nvim-lua/plenary.nvim": "nvim_plugin-nvim-lua/plenary.nvim",
"nvim_plugin-nvim-lualine/lualine.nvim": "nvim_plugin-nvim-lualine/lualine.nvim", "nvim_plugin-nvim-lualine/lualine.nvim": "nvim_plugin-nvim-lualine/lualine.nvim",
@ -963,11 +946,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1761532837, "lastModified": 1761619008,
"narHash": "sha256-78mCSQgC/a6/0vWYrvE/g9E3gGsJLyBBGtmHe3ZOLG4=", "narHash": "sha256-vp97eNmi5GG/+jlvnBpmG6EVO2F1+nqMQFF9GT2TIQg=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "4f5f89f1cfd8553b1285a4a0879ea1b2b05ad286", "rev": "7bc7d2f706ebe5479d230d2c6806b5dc757ae4cd",
"type": "github" "type": "github"
}, },
"original": { "original": {

112
flake.nix
View file

@ -126,8 +126,8 @@
"nvim_plugin-rafamadriz/friendly-snippets".flake = false; "nvim_plugin-rafamadriz/friendly-snippets".flake = false;
"nvim_plugin-ron-rs/ron.vim".url = "github:ron-rs/ron.vim"; "nvim_plugin-ron-rs/ron.vim".url = "github:ron-rs/ron.vim";
"nvim_plugin-ron-rs/ron.vim".flake = false; "nvim_plugin-ron-rs/ron.vim".flake = false;
"nvim_plugin-nosduco/remote-sshfs.nvim".url = "github:nosduco/remote-sshfs.nvim"; # "nvim_plugin-nosduco/remote-sshfs.nvim".url = "github:nosduco/remote-sshfs.nvim";
"nvim_plugin-nosduco/remote-sshfs.nvim".flake = false; # "nvim_plugin-nosduco/remote-sshfs.nvim".flake = false;
}; };
outputs = outputs =
{ {
@ -141,7 +141,7 @@
# work then we make a new version name. Helps separate any files and # work then we make a new version name. Helps separate any files and
# "version" my neovim flake. Use this name for custom .config location # "version" my neovim flake. Use this name for custom .config location
# ================== # ==================
version = "hydrogen"; version = "helium";
# =================== # ===================
# Utilities # Utilities
@ -170,44 +170,6 @@
"nvim_plugin-nvim-treesitter/nvim-treesitter" = nvim-treesitter.withAllGrammars; "nvim_plugin-nvim-treesitter/nvim-treesitter" = nvim-treesitter.withAllGrammars;
}; };
# avante-nvim-lib = pkgs.rustPlatform.buildRustPackage {
# pname = "avante-nvim-lib";
# version = "0.0.0";
# src = inputs."nvim_plugin-yetone/avante.nvim";
#
# buildFeatures = [ "luajit" ];
# doCheck = false;
# cargoLock = {
# lockFile = inputs."nvim_plugin-yetone/avante.nvim" + "/Cargo.lock";
# allowBuiltinFetchGit = true;
# };
#
# nativeBuildInputs = with pkgs; [
# pkg-config
# ];
#
# buildInputs = with pkgs; [
# openssl.dev
# ];
# env = {
# OPENSSL_NO_VENDOR = "1";
# OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib";
# OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include";
# OPENSSL_DIR = "${pkgs.openssl.dev}";
# };
# postInstall = ''
# # mv $out/lib/libavante_repo_map.so $out/lib/avante_repo_map.so
# for f in $out/lib/lib*; do
# mv "$f" "$out/lib/''${f##*/lib}"
# done
# '';
# meta = {
# description = "Avante nvim libraries";
# homepage = "https://github.com/yetone/avante.nvim";
# license = pkgs.lib.licenses.asl20;
# };
# };
# This will be how we put any nix related stuff into our lua config # This will be how we put any nix related stuff into our lua config
luaNixGlobal = luaNixGlobal =
"NIX=" "NIX="
@ -226,59 +188,12 @@
(builtins.filter (n: builtins.substring 0 12 n == "nvim_plugin-") (builtins.attrNames inputs)); (builtins.filter (n: builtins.substring 0 12 n == "nvim_plugin-") (builtins.attrNames inputs));
}); });
# These are appended at the start of the path so that they take precedence over local install tools # All runtime dependencies are now optional and checked lazily by plugins
# This keeps the neovim flake lean and allows project devShells to provide tools
runtimeDependencies = with pkgs; [ runtimeDependencies = with pkgs; [
# tools ripgrep # search - core to telescope, checked in telescope.lua init
ripgrep # search fd # file finding - improves telescope performance, checked in telescope.lua init
fd # search tree-sitter # highlighting
fzf # search fuzzy
tree-sitter
glow # markdown renderer
curl # http requests
sshfs # remote dev for nosduco/remote-sshfs.nvim
# nodePackages.cspell TODO check out `typos` rust checker instead?
];
# These are appended at the end of the PATH so any local installed tools will take precedence
defaultRuntimeDependencies = with pkgs; [
# linters
markdownlint-cli
biome # (t|s)j[x]
# formatters
stylua
nixfmt-rfc-style
nodePackages.prettier
rustywind
markdownlint-cli2
sql-formatter
libsForQt5.qt5.qtdeclarative # qmlformat
# LSPs
# python312Packages.tiktoken # needed for copilot chat
nil # nix
lua-language-server
vscode-langservers-extracted # HTML/CSS/JSON/ESLint
nodePackages.typescript-language-server
nodePackages.svelte-language-server
tailwindcss-language-server
python312Packages.python-lsp-server
rust-analyzer
marksman # markdown
taplo # toml
yaml-language-server
lemminx # xml
gopls # go
# ocamlPackages.ocaml-lsp # ocaml
# Other
typescript
nodejs_24
clang
# zig
(pkgs.rust-bin.stable.latest.default.override {
extensions = [
"rust-src"
"rust-analyzer"
];
})
]; ];
in in
@ -299,16 +214,13 @@
generatedWrapperArgs = generatedWrapperArgs =
old.generatedWrapperArgs or [ ] old.generatedWrapperArgs or [ ]
++ [ ++ [
# Add runtime dependencies to neovim path # Add minimal runtime dependencies to neovim path
"--prefix" # Most tools are now optional and checked at runtime
"PATH" # Project devShells take precedence via --suffix
":"
"${lib.makeBinPath runtimeDependencies}"
# Some we will suffix so we pick up the local dev shell intead and default to these otherwise
"--suffix" "--suffix"
"PATH" "PATH"
":" ":"
"${lib.makeBinPath defaultRuntimeDependencies}" "${lib.makeBinPath runtimeDependencies}"
] ]
++ [ ++ [
# Set the LAZY env path to the nix store, see init.lua for how it is used # Set the LAZY env path to the nix store, see init.lua for how it is used

View file

@ -52,14 +52,17 @@ return {
"stevearc/conform.nvim", "stevearc/conform.nvim",
opts = { opts = {
-- https://github.com/stevearc/conform.nvim?tab=readme-ov-file#setup -- https://github.com/stevearc/conform.nvim?tab=readme-ov-file#setup
-- conform.nvim will notify if formatters are missing when format is attempted
notify_on_error = true, notify_on_error = true,
notify_no_formatters = true,
formatters = { formatters = {
-- v_fmt = { -- v_fmt = {
-- command = "v", -- command = "v",
-- args = { "fmt" }, -- args = { "fmt" },
-- }, -- },
}, },
-- Note that all these need to be available at runtime, add them to flake.nix#runtimeDependencies -- Formatters are checked lazily on format attempt
-- conform.nvim will show errors if formatters are missing
formatters_by_ft = { formatters_by_ft = {
sql = { "sql_formatter", lsp_format = "first" }, sql = { "sql_formatter", lsp_format = "first" },
lua = { "stylua", lsp_format = "first" }, lua = { "stylua", lsp_format = "first" },

View file

@ -121,7 +121,7 @@ return {
names = vim.tbl_filter(function(name) names = vim.tbl_filter(function(name)
local linter = lint.linters[name] local linter = lint.linters[name]
if not linter then if not linter then
LazyVim.warn("Linter not found: " .. name, { title = "nvim-lint" }) vim.notify("Linter not found: " .. name, vim.log.levels.WARN)
end end
return linter and not (type(linter) == "table" and linter.condition and not linter.condition(ctx)) return linter and not (type(linter) == "table" and linter.condition and not linter.condition(ctx))
end, names) end, names)

View file

@ -219,7 +219,16 @@ return {
for _, server_name in ipairs(lsp_servers) do for _, server_name in ipairs(lsp_servers) do
local server_opts = servers[server_name] or {} local server_opts = servers[server_name] or {}
vim.lsp.config(server_name, server_opts) vim.lsp.config(server_name, server_opts)
-- Try to enable LSP and show helpful error if server not found
local ok, err = pcall(function()
vim.lsp.enable(server_name) vim.lsp.enable(server_name)
end)
if not ok then
vim.notify(
string.format("LSP '%s' failed to start. Install it in your project devShell.\nError: %s", server_name, err),
vim.log.levels.ERROR
)
end
end end
else else
-- TODO test this out on a non nix setup... -- TODO test this out on a non nix setup...

View file

@ -4,6 +4,17 @@ return {
default_type = "keep", default_type = "keep",
}, },
cmd = "Glow", cmd = "Glow",
config = function(_, opts)
-- Check for glow when plugin is first used
if not U.cmd_executable("glow") then
vim.notify(
"'glow' not found on PATH. Install it to use markdown preview.",
vim.log.levels.ERROR
)
return
end
require("glow").setup(opts)
end,
keys = { keys = {
{ "<leader>,m", "<cmd>Glow<cr>", desc = "Markdown preview" }, { "<leader>,m", "<cmd>Glow<cr>", desc = "Markdown preview" },
}, },

View file

@ -1,17 +0,0 @@
return {
"nosduco/remote-sshfs.nvim",
cmd = {
"RemoteSshfs",
"RemoteSSHFSConnect",
"RemoteSSHFSDisconnect",
"RemoteSSHFSEdit",
"RemoteSSHFSFindFiles",
"RemoteSSHFSLiveGrep",
},
dependencies = { "nvim-telescope/telescope.nvim" },
opts = {},
config = function(_, opts)
require("remote-sshfs").setup(opts)
require("telescope").load_extension("remote-sshfs")
end,
}

View file

@ -7,11 +7,17 @@ return {
{ "aznhe21/actions-preview.nvim", event = "VeryLazy" }, { "aznhe21/actions-preview.nvim", event = "VeryLazy" },
}, },
init = function() init = function()
-- Check for essential telescope tools
U.cmd_executable("rg", { U.cmd_executable("rg", {
[false] = function() [false] = function()
vim.notify("rg not installed, live grep will not function.", 2) vim.notify("'rg' (ripgrep) not found. Required for telescope live grep. Install it in your environment.", vim.log.levels.ERROR)
end, end,
}) })
-- fd is optional but improves file finding performance
if not U.cmd_executable("fd") then
vim.notify("'fd' not found. Telescope will use 'find' instead (slower). Consider installing fd.", vim.log.levels.INFO)
end
end, end,
cmd = "Telescope", cmd = "Telescope",
opts = function() opts = function()

View file

@ -0,0 +1,33 @@
return {
"nosduco/remote-sshfs.nvim",
init = function()
-- Check if sshfs is available
if not U.cmd_executable("sshfs") then
vim.notify(
"'sshfs' not found on PATH. Required for RemoteSSHFS commands",
vim.log.levels.INFO
)
end
end,
cmd = {
"RemoteSshfs",
"RemoteSSHFSConnect",
"RemoteSSHFSDisconnect",
"RemoteSSHFSEdit",
"RemoteSSHFSFindFiles",
"RemoteSSHFSLiveGrep",
},
dependencies = { "nvim-telescope/telescope.nvim" },
opts = {},
config = function(_, opts)
-- Check for sshfs when plugin is first used
if not U.cmd_executable("sshfs") then
vim.notify(
"'sshfs' not found on PATH. Install it to use RemoteSSHFS commands.",
vim.log.levels.ERROR
)
end
require("remote-sshfs").setup(opts)
require("telescope").load_extension("remote-sshfs")
end,
}

View file

@ -38,6 +38,23 @@ function M.cmd_executable(cmd, callback)
return executable return executable
end end
-- Check if command exists and show helpful error if not
-- @param cmd string: The command to check for
-- @param feature_name string: Human-readable description of what needs this command
-- @param level number: vim.log.levels (ERROR, WARN, INFO, etc.) - defaults to ERROR
-- @return boolean: true if command exists, false otherwise
function M.require_cmd(cmd, feature_name, level)
level = level or vim.log.levels.ERROR
if vim.fn.executable(cmd) ~= 1 then
vim.notify(
string.format("'%s' not found on PATH. Required for: %s", cmd, feature_name),
level
)
return false
end
return true
end
-- [1]: (string) lhs (required) -- [1]: (string) lhs (required)
-- [2]: (string|fun()) rhs (optional) -- [2]: (string|fun()) rhs (optional)
-- mode: (string|string[]) mode (optional, defaults to "n") -- mode: (string|string[]) mode (optional, defaults to "n")