fix lots of nixvim warnings

This commit is contained in:
gwg313 2025-03-23 13:49:03 -04:00
parent 2446716e8f
commit fe4380c766
Signed by: gwg313
GPG key ID: 60FF63B4826B7400
20 changed files with 535 additions and 358 deletions

View file

@ -9,6 +9,7 @@
./thunar.nix
./zen.nix
./xdg.nix
./mime.nix
];
fonts.fontconfig.enable = true;

View file

@ -0,0 +1,39 @@
{
xdg.mimeApps = {
enable = true;
defaultApplications = {
"text/markdown" = "nvim.desktop";
"text/plain" = "nvim.desktop";
"text/x-shellscript" = "nvim.desktop";
"text/x-python" = "nvim.desktop";
"text/x-go" = "nvim.desktop";
"text/css" = "nvim.desktop";
"text/javascript" = "nvim.desktop";
"text/x-c" = "nvim.desktop";
"text/x-c++" = "nvim.desktop";
"text/x-java" = "nvim.desktop";
"text/x-rust" = "nvim.desktop";
"text/x-yaml" = "nvim.desktop";
"text/x-toml" = "nvim.desktop";
"text/x-dockerfile" = "nvim.desktop";
"text/x-xml" = "nvim.desktop";
"text/x-php" = "nvim.desktop";
"image/jpeg" = "imv.desktop";
"image/jpg" = "imv.desktop";
"image/webp" = "imv.desktop";
"image/gif" = "zen.desktop";
"x-scheme-handler/http" = "zen.desktop";
"x-scheme-handler/https" = "zen.desktop";
"text/html" = "zen.desktop";
"application/pdf" = "zathura.desktop";
"image/png" = "imv-dir.desktop";
"x-scheme-handler/chrome" = "zen.desktop";
"application/x-extension-htm" = "zen.desktop";
"application/x-extension-html" = "zen.desktop";
"application/x-extension-shtml" = "zen.desktop";
"application/xhtml+xml" = "zen.desktop";
"application/x-extension-xhtml" = "zen.desktop";
"application/x-extension-xht" = "zen.desktop";
};
};
}

View file

@ -1,29 +1,32 @@
{...}: {
{ ... }:
{
programs.nixvim = {
plugins = {
clangd-extensions = {
enable = true;
enableOffsetEncodingWorkaround = true;
ast = {
roleIcons = {
type = "";
declaration = "";
expression = "";
specifier = "";
statement = "";
templateArgument = "";
};
kindIcons = {
compound = "";
recovery = "";
translationUnit = "";
packExpansion = "";
templateTypeParm = "";
templateTemplateParm = "";
templateParamObject = "";
settings = {
ast = {
role_icons = {
type = "";
declaration = "";
expression = "";
specifier = "";
statement = "";
templateArgument = "";
};
kind_icons = {
compound = "";
recovery = "";
translationUnit = "";
packExpansion = "";
templateTypeParm = "";
templateTemplateParm = "";
templateParamObject = "";
};
};
};
};
};
};

View file

@ -82,6 +82,143 @@
return { lsp_fallback = true }
end
'';
formattersByFt = {
bash = [
"shellcheck"
"shellharden"
"shfmt"
];
bicep = [ "bicep" ];
c = [ "clang_format" ];
cmake = [ "cmake-format" ];
cpp = [ "clang_format" ];
cs = [ "csharpier" ];
css = [ "stylelint" ];
fish = [ "fish_indent" ];
fsharp = [ "fantomas" ];
go = [ "gofmt" ];
haskell = [ "ormolu" ];
javascript = [
[
"prettierd"
"prettier"
]
];
json = [ "jq" ];
lua = [ "stylua" ];
markdown = [ "deno_fmt" ];
nix = [ "nixfmt" ];
python = [
"isort"
"black"
];
rust = [ "rustfmt" ];
sh = [
"shellcheck"
"shellharden"
"shfmt"
];
sql = [ "sqlfluff" ];
swift = [ "swift_format" ];
terraform = [ "terraform_fmt" ];
toml = [ "taplo" ];
typescript = [
[
"prettierd"
"prettier"
]
];
xml = [
"xmlformat"
"xmllint"
];
yaml = [ "yamlfmt" ];
zig = [ "zigfmt" ];
"_" = [
"squeeze_blanks"
"trim_whitespace"
"trim_newlines"
];
};
formatters = {
black = {
command = lib.getExe pkgs.black;
};
bicep = {
command = lib.getExe pkgs.bicep;
};
cmake-format = {
command = lib.getExe pkgs.cmake-format;
};
csharpier = {
command = lib.getExe pkgs.csharpier;
};
deno_fmt = {
command = lib.getExe pkgs.deno;
};
isort = {
command = lib.getExe pkgs.isort;
};
fantomas = {
command = lib.getExe pkgs.fantomas;
};
ormolu = {
command = lib.getExe pkgs.ormolu;
};
jq = {
command = lib.getExe pkgs.jq;
};
nixfmt = {
command = lib.getExe pkgs.nixfmt-rfc-style;
};
prettierd = {
command = lib.getExe pkgs.prettierd;
};
rustfmt = {
command = lib.getExe pkgs.rustfmt;
};
shellcheck = {
command = lib.getExe pkgs.shellcheck;
};
shfmt = {
command = lib.getExe pkgs.shfmt;
};
shellharden = {
command = lib.getExe pkgs.shellharden;
};
sqlfluff = {
command = lib.getExe pkgs.sqlfluff;
};
squeeze_blanks = {
comamnd = lib.getExe' pkgs.coreutils "cat";
};
stylelint = {
command = lib.getExe pkgs.stylelint;
};
stylua = {
command = lib.getExe pkgs.stylua;
};
swift_format = {
command = lib.getExe pkgs.swift-format;
};
taplo = {
command = lib.getExe pkgs.taplo;
};
terraform_fmt = {
command = lib.getExe pkgs.terraform;
};
xmlformat = {
command = lib.getExe pkgs.xmlformat;
};
yamlfmt = {
command = lib.getExe pkgs.yamlfmt;
};
zigfmt = {
command = lib.getExe pkgs.zig;
};
};
};
# NOTE:
@ -92,142 +229,7 @@
# Use the "*" filetype to run formatters on all filetypes.
# Use the "_" filetype to run formatters on filetypes that don't
# have other formatters configured.
formattersByFt = {
bash = [
"shellcheck"
"shellharden"
"shfmt"
];
bicep = [ "bicep" ];
c = [ "clang_format" ];
cmake = [ "cmake-format" ];
cpp = [ "clang_format" ];
cs = [ "csharpier" ];
css = [ "stylelint" ];
fish = [ "fish_indent" ];
fsharp = [ "fantomas" ];
go = [ "gofmt" ];
haskell = [ "ormolu" ];
javascript = [
[
"prettierd"
"prettier"
]
];
json = [ "jq" ];
lua = [ "stylua" ];
markdown = [ "deno_fmt" ];
nix = [ "nixfmt" ];
python = [
"isort"
"black"
];
rust = [ "rustfmt" ];
sh = [
"shellcheck"
"shellharden"
"shfmt"
];
sql = [ "sqlfluff" ];
swift = [ "swift_format" ];
terraform = [ "terraform_fmt" ];
toml = [ "taplo" ];
typescript = [
[
"prettierd"
"prettier"
]
];
xml = [
"xmlformat"
"xmllint"
];
yaml = [ "yamlfmt" ];
zig = [ "zigfmt" ];
"_" = [
"squeeze_blanks"
"trim_whitespace"
"trim_newlines"
];
};
formatters = {
black = {
command = lib.getExe pkgs.black;
};
bicep = {
command = lib.getExe pkgs.bicep;
};
cmake-format = {
command = lib.getExe pkgs.cmake-format;
};
csharpier = {
command = lib.getExe pkgs.csharpier;
};
deno_fmt = {
command = lib.getExe pkgs.deno;
};
isort = {
command = lib.getExe pkgs.isort;
};
fantomas = {
command = lib.getExe pkgs.fantomas;
};
ormolu = {
command = lib.getExe pkgs.ormolu;
};
jq = {
command = lib.getExe pkgs.jq;
};
nixfmt = {
command = lib.getExe pkgs.nixfmt-rfc-style;
};
prettierd = {
command = lib.getExe pkgs.prettierd;
};
rustfmt = {
command = lib.getExe pkgs.rustfmt;
};
shellcheck = {
command = lib.getExe pkgs.shellcheck;
};
shfmt = {
command = lib.getExe pkgs.shfmt;
};
shellharden = {
command = lib.getExe pkgs.shellharden;
};
sqlfluff = {
command = lib.getExe pkgs.sqlfluff;
};
squeeze_blanks = {
comamnd = lib.getExe' pkgs.coreutils "cat";
};
stylelint = {
command = lib.getExe pkgs.stylelint;
};
stylua = {
command = lib.getExe pkgs.stylua;
};
swift_format = {
command = lib.getExe pkgs.swift-format;
};
taplo = {
command = lib.getExe pkgs.taplo;
};
terraform_fmt = {
command = lib.getExe pkgs.terraform;
};
xmlformat = {
command = lib.getExe pkgs.xmlformat;
};
yamlfmt = {
command = lib.getExe pkgs.yamlfmt;
};
zigfmt = {
command = lib.getExe pkgs.zig;
};
};
};
};
};

View file

@ -36,7 +36,8 @@ _: {
./noice.nix
./notify.nix
./precognition.nix
./spectre.nix
# ./spectre.nix
./grug-far.nix
./snacks.nix
./refactoring.nix
./render-markdown.nix

View file

@ -0,0 +1,25 @@
{ ... }:
{
programs.nixvim = {
plugins = {
grug-far = {
enable = true;
settings = {
cmd = "GrugFar";
};
};
};
keymaps = [
{
mode = "n";
key = "<leader>rs";
action = "<cmd>GrugFar<CR>";
options = {
desc = "GrugFar toggle";
silent = true;
};
}
];
};
}

View file

@ -1,9 +1,12 @@
{...}: {
{ ... }:
{
programs.nixvim = {
plugins.lean = {
enable = true;
lsp.enable = false;
abbreviations.enable = false;
settings = {
abbreviations.enable = false;
lsp.enable = false;
};
};
};
}

View file

@ -62,7 +62,7 @@
};
};
servers = {
nil-ls = {
nil_ls = {
enable = true;
filetypes = [ "nix" ];
settings = {

View file

@ -1,8 +1,11 @@
{...}: {
{ ... }:
{
programs.nixvim = {
plugins.navic = {
enable = true;
lsp.autoAttach = true;
settings = {
lsp.autoAttach = true;
};
};
};
}

View file

@ -5,136 +5,140 @@
enable = true;
# Hides the title above noice boxes
cmdline = {
format = {
cmdline = {
pattern = "^:";
icon = "";
lang = "vim";
opts = {
border = {
text = {
top = "Cmd";
};
};
};
};
search_down = {
kind = "search";
pattern = "^/";
icon = " ";
lang = "regex";
};
search_up = {
kind = "search";
pattern = "^%?";
icon = " ";
lang = "regex";
};
filter = {
pattern = "^:%s*!";
icon = "";
lang = "bash";
opts = {
border = {
text = {
top = "Bash";
};
};
};
};
lua = {
pattern = "^:%s*lua%s+";
icon = "";
lang = "lua";
};
help = {
pattern = "^:%s*he?l?p?%s+";
icon = "󰋖";
};
input = { };
};
};
messages = {
view = "mini";
viewError = "mini";
viewWarn = "mini";
};
lsp = {
override = {
"vim.lsp.util.convert_input_to_markdown_lines" = true;
"vim.lsp.util.stylize_markdown" = true;
"cmp.entry.get_documentation" = true;
};
progress.enabled = true;
signature.enabled = true;
};
popupmenu.backend = "nui";
# Doesn't support the standard cmdline completions
# popupmenu.backend = "cmp";
presets = {
bottom_search = false;
command_palette = true;
long_message_to_split = true;
inc_rename = true;
lsp_doc_border = true;
};
settings = {
popupmenu.backend = "nui";
routes = [
{
filter = {
event = "msg_show";
kind = "search_count";
};
opts = {
skip = true;
};
}
{
# skip progress messages from noisy servers
filter = {
event = "lsp";
kind = "progress";
cond.__raw = ''
function(message)
local client = vim.tbl_get(message.opts, 'progress', 'client')
local servers = { 'jdtls' }
routes = [
{
filter = {
event = "msg_show";
kind = "search_count";
};
opts = {
skip = true;
};
}
{
# skip progress messages from noisy servers
filter = {
event = "lsp";
kind = "progress";
cond.__raw = ''
function(message)
local client = vim.tbl_get(message.opts, 'progress', 'client')
local servers = { 'jdtls' }
for index, value in ipairs(servers) do
if value == client then
return true
for index, value in ipairs(servers) do
if value == client then
return true
end
end
end
end
'';
};
opts = {
skip = true;
};
}
];
'';
};
opts = {
skip = true;
};
}
];
views = {
cmdline_popup = {
border = {
style = "single";
views = {
cmdline_popup = {
border = {
style = "single";
};
};
};
confirm = {
border = {
style = "single";
text = {
top = "";
confirm = {
border = {
style = "single";
text = {
top = "";
};
};
};
};
presets = {
bottom_search = false;
command_palette = true;
long_message_to_split = true;
inc_rename = true;
lsp_doc_border = true;
};
lsp = {
override = {
"vim.lsp.util.convert_input_to_markdown_lines" = true;
"vim.lsp.util.stylize_markdown" = true;
"cmp.entry.get_documentation" = true;
};
progress.enabled = true;
signature.enabled = true;
};
messages = {
view = "mini";
viewError = "mini";
viewWarn = "mini";
};
cmdline = {
format = {
cmdline = {
pattern = "^:";
icon = "";
lang = "vim";
opts = {
border = {
text = {
top = "Cmd";
};
};
};
};
search_down = {
kind = "search";
pattern = "^/";
icon = " ";
lang = "regex";
};
search_up = {
kind = "search";
pattern = "^%?";
icon = " ";
lang = "regex";
};
filter = {
pattern = "^:%s*!";
icon = "";
lang = "bash";
opts = {
border = {
text = {
top = "Bash";
};
};
};
};
lua = {
pattern = "^:%s*lua%s+";
icon = "";
lang = "lua";
};
help = {
pattern = "^:%s*he?l?p?%s+";
icon = "󰋖";
};
input = { };
};
};
};
};
};
}

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
programs.nixvim = {
plugins.todo-comments = {
enable = true;
@ -9,54 +10,56 @@
keywords = "TODO,FIX,HACK";
};
};
keywords = {
FIX = {
alt = [
"FIXME"
"BUG"
"FIXIT"
"ISSUE"
];
color = "error";
icon = " ";
};
HACK = {
color = "warning";
icon = " ";
};
NOTE = {
alt = ["INFO"];
color = "hint";
icon = " ";
};
PERF = {
alt = [
"OPTIM"
"PERFORMANCE"
"OPTIMIZE"
];
icon = " ";
};
TEST = {
alt = [
"TESTING"
"PASSED"
"FAILED"
];
color = "test";
icon = " ";
};
TODO = {
color = "info";
icon = " ";
};
WARN = {
alt = [
"WARNING"
"XXX"
];
color = "warning";
icon = " ";
settings = {
keywords = {
FIX = {
alt = [
"FIXME"
"BUG"
"FIXIT"
"ISSUE"
];
color = "error";
icon = " ";
};
HACK = {
color = "warning";
icon = " ";
};
NOTE = {
alt = [ "INFO" ];
color = "hint";
icon = " ";
};
PERF = {
alt = [
"OPTIM"
"PERFORMANCE"
"OPTIMIZE"
];
icon = " ";
};
TEST = {
alt = [
"TESTING"
"PASSED"
"FAILED"
];
color = "test";
icon = " ";
};
TODO = {
color = "info";
icon = " ";
};
WARN = {
alt = [
"WARNING"
"XXX"
];
color = "warning";
icon = " ";
};
};
};
};

View file

@ -1,5 +1,6 @@
# A modern replacement for 'ls'.
{...}: {
{ ... }:
{
programs.ssh = {
enable = true;
hashKnownHosts = true;
@ -48,6 +49,18 @@
user = "gwg313";
identityFile = "/home/gwg313/.ssh/home/id_ed25519";
};
"onedev.local" = {
hostname = "git.local.gwg313.xyz";
user = "gwg313";
identityFile = "/home/gwg313/.ssh/onedev/id_ed25519";
port = 2222;
};
"onedev" = {
hostname = "git.gwg313.xyz";
user = "gwg313";
identityFile = "/home/gwg313/.ssh/onedev/id_ed25519";
port = 2222;
};
};
};
}

View file

@ -4,7 +4,84 @@
inputs,
...
}:
let
accent = "#${config.lib.stylix.colors.base0D}";
background = "#${config.lib.stylix.colors.base00}";
foreground = "#${config.lib.stylix.colors.base05}";
muted = "#${config.lib.stylix.colors.base03}";
settings = ''
{
"config": {
"title" : "Welcome Home",
"openLinksInNewTab": false,
"locale": "en-US",
"colors": {
"primary": "${accent}",
"background": "${background}",
"foreground": "${foreground}",
"muted": "#${muted}"
},
"folders": [
{
"name": "Bookmarks",
"links": [
{"title": "MyNixOs", "url": "https://mynixos.com", "icon": "󱄅"},
{"title": "Github", "url": "https://github.com", "icon": ""},
{"title": "Proton", "url": "https://mail.proton.me/u/0/inbox", "icon": ""},
{"title": "Chat GPT", "url": "https://chat.openai.com/", "icon": "󰭹"},
{"title": "Nixvim", "url": "https://nix-community.github.io/nixvim/", "icon": ""},
{"title": "Hyprland Wiki", "url": "https://wiki.hyprland.org/", "icon": "󰖬"},
{"title": "Youtube", "url": "https://youtube.com", "icon": "󰗃"}
]
},
{
"name": "Uni",
"links": [
{"title": "Outlook", "url": "https://outlook.office.com/mail/", "icon": "󰴢"},
{"title": "Office", "url": "https://www.office.com/?auth=2", "icon": "󰏆"},
{"title": "Teams", "url": "https://teams.microsoft.com/_", "icon": "󰊻"},
{"title": "Brightspace", "url": "https://carleton.ca/brightspace/_", "icon": "󱨡"}
]
}
]
}
}
'';
homepage = pkgs.buildNpmPackage {
pname = "homepage";
version = "0.0.0";
src = pkgs.fetchFromGitHub {
owner = "gwg313";
repo = "homepage";
rev = "b77d35ed3596eb451bd2ec78063d7cc6e73c773d";
hash = "sha256-j/40922kfAh6zqJ4IRYpr66YXNNYsxuXwZ0aiJFJea0=";
};
# npmDepsHash = lib.fakeHash;
npmDepsHash = "sha256-bG+CHTq2Rst3JMxsjAC81KhK+G7WwsTVD1eyP87g0z4=";
buildPhase = ''
npm install
cp ${pkgs.writeText "src/routes/config.json" settings} src/routes/config.json
npm run build
mkdir $out
mv build $out
'';
meta = {
description = "homepage";
homepage = "https://github.com/gwg313/homepage";
};
};
in
{
home.file.".config/homepage" = {
source = "${homepage}/build";
recursive = true;
};
home.packages = with pkgs; [ inputs.zen-browser.packages."${system}".default ];
}