Merge pull request #43 from cnsta/modvim

changes to nixvim and modules.nix files, for easier logic parsing in rust.
This commit is contained in:
cnsta
2024-08-31 20:26:31 +02:00
committed by GitHub
33 changed files with 1490 additions and 438 deletions

View File

@@ -1,40 +0,0 @@
keys:
# Users
- &cnst age1aj6tdyjcxjc3fqda3uvnzy6m49yj4ankvzdstnj3w9dr8hmsccts5vsgd8
- &adam placeholderkey
- &toothpick age1x6zshjaxnjt76pwqspulc9pqp33lsytwvvwvx6ukqlh7xjqv4p3qcqzlyx
# Hosts
- &cnix age1rzee3wxh7773p7ytaq3zcl8q4tpsz3l43rdv2wezetgk0dlz0vws9jcpu2
- &adampad placeholderkey
- &toothpc age1un3d9mnxack229gycahuuw0lngjutfwtc4pned9as085mtynm5nqyyxaak
creation_rules:
- path_regex: secrets/cnix-secrets.(yaml|json|env|ini)$
key_groups:
- age:
- *cnst
- *cnix
- path_regex: secrets/cnst-secrets.(yaml|json|env|ini)$
key_groups:
- age:
- *cnst
- *cnix
- path_regex: secrets/adampad-secrets.(yaml|json|env|ini)$
key_groups:
- age:
- *adam
- *adampad
- path_regex: secrets/adam-secrets.(yaml|json|env|ini)$
key_groups:
- age:
- *adam
- *adampad
# - path_regex: secrets/toothpc-secrets.(yaml|json|env|ini)$
# key_groups:
# - age:
# - *toothpick
# - *toothpc
# - path_regex: secrets/toothpick-secrets.(yaml|json|env|ini)$
# key_groups:
# - age:
# - *toothpick
# - *toothpc

146
flake.lock generated
View File

@@ -82,11 +82,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1724781866, "lastModified": 1724850097,
"narHash": "sha256-ItgACCJCwn8Rx7p8hJBpnU9eCtrdmkg4AbqMZL/rXlY=", "narHash": "sha256-3BHxvFb3NJzch1X8puRMkVZujOoarQ1llu3ZcwuvsKU=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "aquamarine", "repo": "aquamarine",
"rev": "7cc3d3179c06caf3769afb3eb0c69aa55676c96a", "rev": "23c7925dd31e79e8c06086ace3edb129a070ac01",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -123,12 +123,12 @@
"yafas": "yafas" "yafas": "yafas"
}, },
"locked": { "locked": {
"lastModified": 1724848807, "lastModified": 1724976120,
"narHash": "sha256-vnqqX1XTwiPL4lV/xUa9wbDVw3zgT3FjpHYaNqRiCi0=", "narHash": "sha256-ab+ioJFNMI0K2k3ZAaDJKW+B/kQajiPaw4Bmk++uAq8=",
"rev": "82ab7e98b75a39df40658f66272aa159cfb49400", "rev": "c6aca01e74579088d643a5bd1bfcf7a99f9066e7",
"revCount": 1374, "revCount": 1377,
"type": "tarball", "type": "tarball",
"url": "https://api.flakehub.com/f/pinned/chaotic-cx/nyx/0.1.1374%2Brev-82ab7e98b75a39df40658f66272aa159cfb49400/01919927-80d2-70c0-afbc-95bfe6a3f8f7/source.tar.gz?rev=82ab7e98b75a39df40658f66272aa159cfb49400&revCount=1374" "url": "https://api.flakehub.com/f/pinned/chaotic-cx/nyx/0.1.1377%2Brev-c6aca01e74579088d643a5bd1bfcf7a99f9066e7/0191a0ac-7734-737a-bdbd-10af179ac962/source.tar.gz?rev=c6aca01e74579088d643a5bd1bfcf7a99f9066e7&revCount=1377"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
@@ -222,11 +222,11 @@
"rust-analyzer-src": "rust-analyzer-src" "rust-analyzer-src": "rust-analyzer-src"
}, },
"locked": { "locked": {
"lastModified": 1724826636, "lastModified": 1724913098,
"narHash": "sha256-hz8Szf5J9oQg6EeMhHE/eKuexoHPiDbmOZTPvijYwyM=", "narHash": "sha256-CgAGpxcTUwkbA2pjjnpLclSKI/DYZ55B8uPmwoXCorI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "fenix", "repo": "fenix",
"rev": "3454a665ff4dd29cf618e6a2e53065370876297f", "rev": "2d808ed09caffa0984a6d54bc1558959d48b012b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -243,11 +243,11 @@
"rust-analyzer-src": "rust-analyzer-src_2" "rust-analyzer-src": "rust-analyzer-src_2"
}, },
"locked": { "locked": {
"lastModified": 1724826636, "lastModified": 1724999484,
"narHash": "sha256-hz8Szf5J9oQg6EeMhHE/eKuexoHPiDbmOZTPvijYwyM=", "narHash": "sha256-AIR8uYGteWS/RyHyZJAHQAUEJ/Mv4ktkPe2mzbJ2zCE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "fenix", "repo": "fenix",
"rev": "3454a665ff4dd29cf618e6a2e53065370876297f", "rev": "e3bb9176e807e2b166d54153ce8caea5cb2c6700",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -265,11 +265,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1724904198, "lastModified": 1725014336,
"narHash": "sha256-KVK7fRmpD4RcAH1wzq4gXqLzr2eHzkDrRc0aAyKTyt8=", "narHash": "sha256-4sLMoyIIRR2eRNCcQN1N7UEtuETpa0KrnJOe3vKJm3I=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "9e63f0ed86c157ce26b3fd56ee908a726713dfed", "rev": "c4261180db65409bd3a71bd300c97313d5d37051",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@@ -290,11 +290,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1724899320, "lastModified": 1724980034,
"narHash": "sha256-C7x+GwFa9FGUlnVjNYSIrvj0aFaqnbg6KmzDT8hNbQw=", "narHash": "sha256-aihnQNfqq9W5C6OPZIGpScwyhjZpP92oT2aepc+vKFA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "flake-firefox-nightly", "repo": "flake-firefox-nightly",
"rev": "9cb29975e9142471489c582b99cba9db9c01432a", "rev": "85f50a52e3c33477599b7463398d2ddca68d21ad",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -391,11 +391,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1722555600, "lastModified": 1725015982,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", "narHash": "sha256-1WXS/BBKZUcWlfeZL7U8ujuCdlLktImbpmJgN9zsZXM=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d", "rev": "4f37dc19b47b50512008f38858734f8fa8a4e0cc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -769,11 +769,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1724874889, "lastModified": 1724967012,
"narHash": "sha256-Zb+IQjUMSE+6LPMg9HuxVvHHJsamU5VB13tD7XmBugY=", "narHash": "sha256-Zn5Eq6Elq0SRInPrEYGGoo972JzVxd5zExF7FSuTKlo=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "b9b8e6220f55af34e862b541a5a4b30ae6d8f15f", "rev": "604eb21a7e55d85ec7f6cb8cba39fc4c20a07a9d",
"revCount": 5155, "revCount": 5157,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"
@@ -881,11 +881,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1724235914, "lastModified": 1724927767,
"narHash": "sha256-QEVuZNXkytS1lqAtRMBAriJREcCTOeprxBTisXxpe3s=", "narHash": "sha256-ktnK4QJsbM4+8TQCxeWujvozDo50CldgNGCJ6Omuz/0=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprlock", "repo": "hyprlock",
"rev": "7bb4113a7e9cb62120e96d7c81066f0c055f0db4", "rev": "9c1e9e7db2f2746ad9ee144543a786a4da591c7b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -906,11 +906,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1722869141, "lastModified": 1724863980,
"narHash": "sha256-0KU4qhyMp441qfwbirNg3+wbm489KnEjXOz2I/RbeFs=", "narHash": "sha256-7Ke9wFRYPUIXwm5ZndGHkWBKj6BsFTkSEXUNXQRHE54=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprutils", "repo": "hyprutils",
"rev": "0252fd13e78e60fb0da512a212e56007515a49f7", "rev": "aadf9a27dddd2272ca354ba5a22a0c2d1f919039",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -953,11 +953,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1724837759, "lastModified": 1724908834,
"narHash": "sha256-gt1mCTlqnirTHAG8Q90IWEs91fRsTSjBqXhb6bQboe8=", "narHash": "sha256-QYtm4H+nzO8lYJYN6TfitmZ5jvb94YqY5MGWvZRCre8=",
"owner": "Jovian-Experiments", "owner": "Jovian-Experiments",
"repo": "Jovian-NixOS", "repo": "Jovian-NixOS",
"rev": "a679e3a0ef9d3d43639f7ba894069c43e2d39c2c", "rev": "0ce5684924f553c65828041a86e7e3e09aeaac29",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1167,11 +1167,11 @@
}, },
"nixpkgs-small": { "nixpkgs-small": {
"locked": { "locked": {
"lastModified": 1724870369, "lastModified": 1724938759,
"narHash": "sha256-dGHUOi1tBiVOsVdT9QNEuk+FuSMtQxkyx+9CN/34kkk=", "narHash": "sha256-1fBHjcU/bh+ivx/uttMjgF5eTI1s9nyxyrZmgEeutns=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "215ea7473ff80eb6cb157ee07223920cc53f4b09", "rev": "314ab2d44863ce4e5fd47b6575938b323804f1f4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1197,22 +1197,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1721524707,
"narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "556533a23879fc7e5f98dd2e0b31a6911a213171",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1717196966, "lastModified": 1717196966,
@@ -1231,11 +1215,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1724479785, "lastModified": 1724819573,
"narHash": "sha256-pP3Azj5d6M5nmG68Fu4JqZmdGt4S4vqI5f8te+E/FTw=", "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d0e1602ddde669d5beb01aec49d71a51937ed7be", "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1247,11 +1231,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1724224976, "lastModified": 1724819573,
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1337,11 +1321,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1724910392, "lastModified": 1724968633,
"narHash": "sha256-+eAf/UTXPvjMqBXCHaYgJ1SnTsv5w4dE3etga4RBiWw=", "narHash": "sha256-eb2NCdLwfXL1MuTAkoDncSl2lCJwyylV5/NM1Ws2P/U=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "bc7f4166f475bf16b8dac90dc660730ba502c024", "rev": "2704133fe3ca616b22ed6685cc67180456eb4160",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1423,18 +1407,17 @@
"nixpkgs": "nixpkgs_7", "nixpkgs": "nixpkgs_7",
"nixpkgs-small": "nixpkgs-small", "nixpkgs-small": "nixpkgs-small",
"nixvim": "nixvim", "nixvim": "nixvim",
"sops-nix": "sops-nix",
"systems": "systems_8" "systems": "systems_8"
} }
}, },
"rust-analyzer-src": { "rust-analyzer-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1724761543, "lastModified": 1724841371,
"narHash": "sha256-G4z3E2PbuAIJ4CSss6Fxs0HMSpnaxMMUFCdyVahAppg=", "narHash": "sha256-k6WsRPDn+mZ67Aggh6miUZdGvDmbqlI+N1PJ+hi3znw=",
"owner": "rust-lang", "owner": "rust-lang",
"repo": "rust-analyzer", "repo": "rust-analyzer",
"rev": "8db40df2a3c1c3b18402c4844643d2fb6dce87d6", "rev": "f454ea877180f0fd8d53390a1d9e6bdd6047b35d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1447,11 +1430,11 @@
"rust-analyzer-src_2": { "rust-analyzer-src_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1724761543, "lastModified": 1724937894,
"narHash": "sha256-G4z3E2PbuAIJ4CSss6Fxs0HMSpnaxMMUFCdyVahAppg=", "narHash": "sha256-M/28TIG+fm5x3GtQ6qSGDw1NHS4nHttz0DM7JcDs4g8=",
"owner": "rust-lang", "owner": "rust-lang",
"repo": "rust-analyzer", "repo": "rust-analyzer",
"rev": "8db40df2a3c1c3b18402c4844643d2fb6dce87d6", "rev": "0ae42bd42576566540a84c62e118aa823edcf2ec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1482,27 +1465,6 @@
"type": "github" "type": "github"
} }
}, },
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1723501126,
"narHash": "sha256-N9IcHgj/p1+2Pvk8P4Zc1bfrMwld5PcosVA0nL6IGdE=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "be0eec2d27563590194a9206f551a6f73d52fa34",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,

View File

@@ -3,6 +3,7 @@
"${userModules}/browsers/chromium" "${userModules}/browsers/chromium"
"${userModules}/browsers/firefox" "${userModules}/browsers/firefox"
"${userModules}/comm/discord" "${userModules}/comm/discord"
#"${userModules}/devtools/neovim"
"${userModules}/devtools/nixvim" "${userModules}/devtools/nixvim"
"${userModules}/devtools/vscode" "${userModules}/devtools/vscode"
"${userModules}/gaming/lutris" "${userModules}/gaming/lutris"

View File

@@ -0,0 +1,61 @@
-- Faster completion
vim.opt.updatetime = 100
-- Line numbers
vim.opt.relativenumber = false -- Relative line numbers
vim.opt.number = true -- Display the absolute line number of the current line
-- Buffer and window options
vim.opt.hidden = true -- Keep closed buffer open in the background
vim.opt.showmode = false -- Do not show the mode in the command line
vim.opt.mouse = "a" -- Enable mouse control
vim.opt.mousemodel = "popup" -- Mouse right-click extends the current selection
vim.opt.splitbelow = true -- A new window is put below the current one
vim.opt.splitright = true -- A new window is put right of the current one
-- List options
vim.opt.list = true
vim.opt.listchars = {
tab = "",
trail = "·",
nbsp = "",
extends = "",
precedes = "",
}
-- Swap and undo files
vim.opt.swapfile = false -- Disable the swap file
vim.opt.modeline = true -- Tags such as 'vim:ft=sh'
vim.opt.modelines = 100 -- Sets the type of modelines
vim.opt.undofile = true -- Automatically save and restore undo history
-- Search options
vim.opt.incsearch = true -- Incremental search: show match for partly typed search command
vim.opt.inccommand = "split" -- Search and replace: preview changes in quickfix list
vim.opt.ignorecase = true -- When the search query is lower-case, match both lower and upper-case patterns
vim.opt.smartcase = true -- Override the 'ignorecase' option if the search pattern contains upper case characters
-- Scrolling and cursor options
vim.opt.scrolloff = 4 -- Number of screen lines to show around the cursor
vim.opt.cursorline = true -- Highlight the screen line of the cursor
vim.opt.cursorcolumn = false -- Highlight the screen column of the cursor
vim.opt.signcolumn = "yes" -- Whether to show the signcolumn
-- Display options
vim.opt.colorcolumn = "" -- Columns to highlight
vim.opt.laststatus = 3 -- When to use a status line for the last window
vim.opt.fileencoding = "utf-8" -- File-content encoding for the current buffer
vim.opt.spell = false -- Highlight spelling mistakes (local to window)
vim.opt.wrap = false -- Prevent text from wrapping
-- Tab options
vim.opt.tabstop = 4 -- Number of spaces a <Tab> in the text stands for (local to buffer)
vim.opt.shiftwidth = 4 -- Number of spaces used for each step of (auto)indent (local to buffer)
vim.opt.expandtab = true -- Expand <Tab> to spaces in Insert mode (local to buffer)
vim.opt.autoindent = true -- Do clever autoindenting
-- Text width
vim.opt.textwidth = 0 -- Maximum width of text that is being inserted
-- Folding
vim.opt.foldlevel = 99 -- Folds with a level higher than this number will be closed

View File

@@ -0,0 +1,39 @@
local lspc = require'lspconfig'
-- Setup for LSP servers
lspc.tsserver.setup({
on_attach = function(client, bufnr)
client.resolved_capabilities.document_formatting = false
client.resolved_capabilities.document_range_formatting = false
local ts_utils = require("nvim-lsp-ts-utils")
ts_utils.setup({})
ts_utils.setup_client(client)
local buf_map = function(bufnr, mode, lhs, rhs, opts)
vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts or { silent = true })
end
buf_map(bufnr, "n", "gs", ":TSLspOrganize<CR>")
buf_map(bufnr, "n", "gi", ":TSLspRenameFile<CR>")
buf_map(bufnr, "n", "go", ":TSLspImportAll<CR>")
-- Custom on_attach functionality
on_attach(client, bufnr)
end,
})
lspc.cssls.setup{}
lspc.clangd.setup{}
lspc.tailwindcss.setup{}
lspc.html.setup{}
lspc.astro.setup{}
lspc.phpactor.setup{}
lspc.pyright.setup{}
lspc.marksman.setup{}
lspc.nixd.setup{}
lspc.dockerls.setup{}
lspc.bashls.setup{}
lspc.csharp_ls.setup{}
lspc.yamlls.setup{}
lspc.lua_ls.setup({
})

View File

@@ -0,0 +1,73 @@
local has_words_before = function()
local line, col = table.unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local feedkey = function(key, mode)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
end
local cmp = require("cmp")
local lspkind = require("lspkind")
cmp.setup({
sources = {
{ name = "nvim_lsp" },
{ name = "cmp_tabnine" },
{ name = "treesitter" },
{ name = "buffer" },
{ name = "path" },
{ name = "vsnip" },
-- { name = "copilot" },
},
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
formatting = {
format = lspkind.cmp_format({
with_text = true,
menu = {
buffer = "[Buf]",
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
latex_symbols = "[Latex]",
treesitter = "[TS]",
cmp_tabnine = "[TN]",
vsnip = "[Snip]",
},
}),
},
mapping = {
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif vim.fn["vsnip#available"](1) == 1 then
feedkey("<Plug>(vsnip-expand-or-jump)", "")
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function()
if cmp.visible() then
cmp.select_prev_item()
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
feedkey("<Plug>(vsnip-jump-prev)", "")
end
end, {
"i",
"s",
}),
},
})

View File

@@ -0,0 +1,20 @@
-- Set colorscheme
vim.cmd("set termguicolors")
-- Configure gruvbox-material
vim.g.gruvbox_material_background = "medium" -- Options: 'hard', 'medium', 'soft'
vim.g.gruvbox_material_palette = "material" -- Options: 'material', 'original', 'palenight'
-- Load the gruvbox-material colorscheme
vim.cmd([[colorscheme gruvbox-material]])
-- Enable colorizer
require("colorizer").setup()
-- set sign
vim.cmd("sign define DiagnosticSignError text= linehl= texthl=DiagnosticSignError numhl=")
vim.cmd("sign define DiagnosticSignHint text= linehl= texthl=DiagnosticSignHint numhl=")
vim.cmd("sign define DiagnosticSignInfo text= linehl= texthl=DiagnosticSignInfo numhl=")
vim.cmd("sign define DiagnosticSignWarn text= linehl= texthl=DiagnosticSignWarn numhl=")
-- set lightline theme to horizon
vim.g.lightline = { colorscheme = "apprentice" }

View File

@@ -0,0 +1,14 @@
require'nvim-treesitter.configs'.setup {
textobjects = {
select = {
enable = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
},
}

View File

@@ -0,0 +1,25 @@
require("nvim-treesitter.configs").setup({
highlight = {
enable = true,
disable = {},
},
rainbow = {
enable = true,
extended_mode = true,
},
autotag = {
enable = true,
},
context_commentstring = {
enable = true,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
})

View File

@@ -0,0 +1,39 @@
-- telescope
require("telescope").load_extension("fzy_native")
-- null-ls
local nb = require("null-ls").builtins
require("null-ls").setup({
sources = {
nb.formatting.alejandra,
nb.code_actions.statix,
nb.diagnostics.cppcheck,
nb.diagnostics.deadnix,
nb.diagnostics.statix,
nb.diagnostics.eslint,
nb.completion.spell,
},
})
require("gitsigns").setup()
-- autopairs
require("nvim-autopairs").setup({})
-- copy to system clipboard
vim.api.nvim_set_keymap("v", "<Leader>y", '"+y', { noremap = true })
vim.api.nvim_set_keymap("n", "<Leader>y", ":%+y<CR>", { noremap = true })
-- paste from system clipboard
vim.api.nvim_set_keymap("n", "<Leader>p", '"+p', { noremap = true })
-- textyankpost autocmd
vim.api.nvim_create_augroup("highlight_yank", { clear = true })
vim.api.nvim_create_autocmd("TextYankPost", {
group = "highlight_yank",
desc = "Highlight when yanking (copying) text",
callback = function()
vim.highlight.on_yank()
end,
})

View File

@@ -0,0 +1,52 @@
-- Updated Which-Key Spec
local wk = require("which-key")
wk.setup {}
wk.register({
["<leader>"] = {
["/"] = { "<cmd>Telescope live_grep<cr>", "Live Grep" },
P = { '"+P', "Paste from clipboard before cursor" },
a = { "<cmd>lua require('telescope.builtin').lsp_code_actions()<cr>", "Code Actions" },
ac = { "<cmd>CopilotChatToggle<CR>", "Toggle Copilot chat" },
b = { "<cmd>Telescope buffers<cr>", "Buffers" },
d = { "<cmd>lua require('telescope.builtin').lsp_document_diagnostics()<cr>", "LSP Diagnostics" },
f = { "<cmd>Telescope find_files<cr>", "Find File" },
g = {
b = { "<cmd>ToggleBlameLine<cr>", "Toggle BlameLine" },
c = { "<cmd>Neogit commit<cr>", "Commit" },
i = { "<cmd>lua require('telescope').extensions.gh.issues()<cr>", "Github Issues" },
name = "Git / VCS",
p = { "<cmd>lua require('telescope').extensions.gh.pull_request()<cr>", "Github PRs" },
s = { "<cmd>Neogit kind=split<cr>", "Staging" }
},
k = { "<cmd>lua vim.lsp.buf.signature_help()<cr>", "Signature Help" },
l = {
e = { "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<cr>", "Show Line Diagnostics" },
f = { "<cmd>lua vim.lsp.buf.formatting_sync()<cr>", "Format file" },
name = "LSP",
q = { "<cmd>lua vim.lsp.diagnostic.set_loclist()<cr>", "Set Loclist" }
},
p = { '"+p', "Paste from clipboard" },
qc = { "<cmd>lua local input = vim.fn.input('Quick Chat: '); if input ~= '' then require('CopilotChat').ask(input, { selection = require('CopilotChat.select').buffer }) end<CR>", "CopilotChat - Quick chat" },
y = { '"+y', "Yank to clipboard" }
},
g = {
e = { "G", "Bottom" },
h = { "0", "Line start" },
l = { "$", "Line end" },
s = { "^", "First non-blank in line" }
},
i = {
["<C-v>"] = { "<esc>p", "Paste in Insert Mode" }
},
v = {
["<"] = { "<gv", "Indent Left" },
["<C-c>"] = { "y", "Yank Selection" },
["<S-TAB>"] = { "<gv", "Indent Left" },
["<TAB>"] = { ">gv", "Indent Right" },
[">"] = { ">gv", "Indent Right" },
J = { ":m '>+1<CR>gv=gv", "Move Down" },
K = { ":m '<-2<CR>gv=gv", "Move Up" }
}
}, { prefix = "" })

View File

@@ -0,0 +1,81 @@
{
pkgs,
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.devtools.neovim;
in {
options = {
modules.devtools.neovim.enable = mkEnableOption "Enables neovim";
};
config = mkIf cfg.enable {
programs.neovim = {
enable = true;
vimAlias = true;
viAlias = true;
vimdiffAlias = true;
plugins = with pkgs.vimPlugins; [
gruvbox-material-nvim
nvim-web-devicons
comment-nvim
cmp-buffer
cmp-nvim-lsp
cmp-path
cmp-spell
cmp-treesitter
cmp-vsnip
friendly-snippets
gitsigns-nvim
lightline-vim
lspkind-nvim
neogit
null-ls-nvim
nvim-autopairs
nvim-cmp
nvim-colorizer-lua
nvim-lspconfig
nvim-tree-lua
(nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars))
plenary-nvim
rainbow-delimiters-nvim
telescope-fzy-native-nvim
telescope-nvim
vim-floaterm
vim-sneak
vim-vsnip
which-key-nvim
copilot-lua
copilot-cmp
statix
phpactor
];
extraPackages = with pkgs; [nixd gcc ripgrep fd deadnix lua-language-server yaml-language-server bash-language-server];
extraConfig = let
luaRequire = module:
builtins.readFile (builtins.toString
./config
+ "/${module}.lua");
luaConfig = builtins.concatStringsSep "\n" (map luaRequire [
"init"
"lspconfig"
"nvim-cmp"
"theming"
"treesitter"
"treesitter-textobjects"
"utils"
"which-key"
]);
in ''
lua << 
${luaConfig}

'';
};
};
}

View File

@@ -1,51 +1,148 @@
{ {
programs.nixvim = { programs.nixvim = {
opts.completeopt = ["menu" "menuone" "noselect"];
plugins = { plugins = {
luasnip.enable = true; luasnip.enable = true;
cmp-buffer = {enable = true;};
lspkind = { cmp-emoji = {enable = true;};
enable = true; cmp-nvim-lsp = {enable = true;};
cmp-path = {enable = true;};
cmp_luasnip = {enable = true;};
cmp = { cmp = {
enable = true; enable = true;
menu = {
nvim_lsp = "[LSP]";
nvim_lua = "[api]";
path = "[path]";
luasnip = "[snip]";
buffer = "[buffer]";
};
};
};
cmp = {
enable = true;
settings = { settings = {
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; experimental = {ghost_text = true;};
snippet.expand = ''
mapping = { function(args)
"<C-d>" = "cmp.mapping.scroll_docs(-4)"; require('luasnip').lsp_expand(args.body)
"<C-f>" = "cmp.mapping.scroll_docs(4)"; end
"<C-Space>" = "cmp.mapping.complete()"; '';
"<C-e>" = "cmp.mapping.close()";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<CR>" = "cmp.mapping.confirm({ select = true })";
};
sources = [ sources = [
{name = "path";}
{name = "nvim_lsp";} {name = "nvim_lsp";}
{name = "luasnip";} {name = "luasnip";}
{ {
name = "buffer"; name = "buffer";
# Words from other open buffers can also be suggested.
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
} }
{name = "nvim_lua";}
{name = "path";}
{name = "copilot";}
]; ];
formatting = {
fields = ["abbr" "kind" "menu"];
format =
# lua
''
function(_, item)
local icons = {
Namespace = "󰌗",
Text = "󰉿",
Method = "󰆧",
Function = "󰆧",
Constructor = "",
Field = "󰜢",
Variable = "󰀫",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "󰑭",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈚",
Reference = "󰈇",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "󰙅",
Event = "",
Operator = "󰆕",
TypeParameter = "󰊄",
Table = "",
Object = "󰅩",
Tag = "",
Array = "[]",
Boolean = "",
Number = "",
Null = "󰟢",
String = "󰉿",
Calendar = "",
Watch = "󰥔",
Package = "",
Copilot = "",
Codeium = "",
TabNine = "",
}
local icon = icons[item.kind] or ""
item.kind = string.format("%s %s", icon, item.kind or "")
return item
end
'';
};
window = {
completion = {
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
scrollbar = false;
sidePadding = 0;
border = ["" "" "" "" "" "" "" ""];
};
settings.documentation = {
border = ["" "" "" "" "" "" "" ""];
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
};
};
mapping = {
"<C-l>" = "cmp.mapping.select_prev_item()";
"<C-ä>" = "cmp.mapping.select_next_item()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<S-Tab>" = "cmp.mapping.close()";
"<Tab>" =
# lua
''
function(fallback)
local line = vim.api.nvim_get_current_line()
if line:match("^%s*$") then
fallback()
elseif cmp.visible() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })
else
fallback()
end
end
'';
"<Down>" =
# lua
''
function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
else
fallback()
end
end
'';
"<Up>" =
# lua
''
function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
else
fallback()
end
end
'';
};
}; };
}; };
}; };

View File

@@ -12,7 +12,6 @@ in {
inputs.nixvim.homeManagerModules.nixvim inputs.nixvim.homeManagerModules.nixvim
./plugins ./plugins
./autocmd.nix ./autocmd.nix
./completion.nix
./keymap.nix ./keymap.nix
./options.nix ./options.nix
./todo.nix ./todo.nix
@@ -24,7 +23,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.nixvim = { programs.nixvim = {
extraPlugins = [pkgs.vimPlugins.gruvbox-material]; extraPlugins = with pkgs.vimPlugins; [gruvbox-material-nvim nvim-web-devicons];
colorscheme = "gruvbox-material"; colorscheme = "gruvbox-material";
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
@@ -32,13 +31,8 @@ in {
vimAlias = true; vimAlias = true;
luaLoader.enable = true; luaLoader.enable = true;
plugins = { plugins = {
gitsigns = { gitsigns.enable = true;
enable = true; statuscol.enable = true;
settings.signs = {
add.text = "+";
change.text = "~";
};
};
nvim-autopairs.enable = true; nvim-autopairs.enable = true;
nvim-colorizer = { nvim-colorizer = {
enable = true; enable = true;

View File

@@ -0,0 +1,163 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.cmp;
in {
options = {
modules.devtools.nixvim.plugins.cmp.enable = mkEnableOption "Enables completion plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim = {
plugins = {
luasnip.enable = true;
cmp-buffer = {enable = true;};
cmp-emoji = {enable = true;};
cmp-nvim-lsp = {enable = true;};
cmp-path = {enable = true;};
cmp_luasnip = {enable = true;};
cmp = {
enable = true;
settings = {
experimental = {ghost_text = true;};
snippet.expand = ''
function(args)
require('luasnip').lsp_expand(args.body)
end
'';
sources = [
{name = "nvim_lsp";}
{name = "luasnip";}
{
name = "buffer";
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
}
{name = "nvim_lua";}
{name = "path";}
{name = "copilot";}
];
formatting = {
fields = ["abbr" "kind" "menu"];
format =
# lua
''
function(_, item)
local icons = {
Namespace = "󰌗",
Text = "󰉿",
Method = "󰆧",
Function = "󰆧",
Constructor = "",
Field = "󰜢",
Variable = "󰀫",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "󰑭",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈚",
Reference = "󰈇",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "󰙅",
Event = "",
Operator = "󰆕",
TypeParameter = "󰊄",
Table = "",
Object = "󰅩",
Tag = "",
Array = "[]",
Boolean = "",
Number = "",
Null = "󰟢",
String = "󰉿",
Calendar = "",
Watch = "󰥔",
Package = "",
Copilot = "",
Codeium = "",
TabNine = "",
}
local icon = icons[item.kind] or ""
item.kind = string.format("%s %s", icon, item.kind or "")
return item
end
'';
};
window = {
completion = {
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
scrollbar = false;
sidePadding = 0;
border = ["" "" "" "" "" "" "" ""];
};
settings.documentation = {
border = ["" "" "" "" "" "" "" ""];
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
};
};
mapping = {
"<C-l>" = "cmp.mapping.select_prev_item()";
"<C-ä>" = "cmp.mapping.select_next_item()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<S-Tab>" = "cmp.mapping.close()";
"<Tab>" =
# lua
''
function(fallback)
local line = vim.api.nvim_get_current_line()
if line:match("^%s*$") then
fallback()
elseif cmp.visible() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })
else
fallback()
end
end
'';
"<Down>" =
# lua
''
function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
else
fallback()
end
end
'';
"<Up>" =
# lua
''
function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
else
fallback()
end
end
'';
};
};
};
};
};
};
}

View File

@@ -1,35 +1,44 @@
{ {
lib, lib,
config, config,
pkgs,
... ...
}: let }: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.conform-nvim; cfg = config.modules.devtools.nixvim.plugins.conform;
in { in {
options = { options = {
modules.devtools.nixvim.plugins.conform-nvim.enable = mkEnableOption "Enables Conform plugin for nixvim"; modules.devtools.nixvim.plugins.conform.enable = mkEnableOption "Enables Conform plugin for nixvim";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.nixvim.plugins.conform-nvim = { programs.nixvim.plugins.conform = {
enable = true; enable = true;
settings = { settings = {
notify_on_error = true; notify_on_error = true;
formatters_by_ft = { formatters_by_ft = {
liquidsoap = ["liquidsoap-prettier"]; html = ["prettierd" "prettier"];
html = [["prettierd" "prettier"]]; css = ["prettierd" "prettier"];
css = [["prettierd" "prettier"]]; javascript = ["prettierd" "prettier"];
javascript = [["prettierd" "prettier"]]; javascriptreact = ["prettierd" "prettier"];
javascriptreact = [["prettierd" "prettier"]]; typescript = ["prettierd" "prettier"];
typescript = [["prettierd" "prettier"]]; typescriptreact = ["prettierd" "prettier"];
typescriptreact = [["prettierd" "prettier"]];
python = ["black"]; python = ["black"];
lua = ["stylua"]; lua = ["stylua"];
nix = ["alejandra"]; nix = ["alejandra"];
markdown = [["prettierd" "prettier"]]; markdown = ["prettierd" "prettier"];
yaml = ["yamllint" "yamlfmt"]; yaml = ["yamlfmt"];
}; rust = ["rustfmt"];
xml = ["xmllint"];
php = ["php-cs-fixer"];
};
stop_after_first = true;
}; };
}; };
home.packages = with pkgs; [
prettierd
yamlfmt
libxml2Python
];
}; };
} }

View File

@@ -19,11 +19,11 @@ in {
copilot-lua = { copilot-lua = {
enable = true; enable = true;
suggestion = { suggestion = {
enabled = true; enabled = false;
autoTrigger = true; autoTrigger = true;
keymap.accept = "<C-CR>"; keymap.accept = "<C-CR>";
}; };
panel.enabled = true; panel.enabled = false;
}; };
}; };
keymaps = [ keymaps = [

View File

@@ -3,12 +3,14 @@
"${userModules}/devtools/nixvim/plugins/barbar.nix" "${userModules}/devtools/nixvim/plugins/barbar.nix"
"${userModules}/devtools/nixvim/plugins/comment.nix" "${userModules}/devtools/nixvim/plugins/comment.nix"
"${userModules}/devtools/nixvim/plugins/conform.nix" "${userModules}/devtools/nixvim/plugins/conform.nix"
"${userModules}/devtools/nixvim/plugins/cmp.nix"
"${userModules}/devtools/nixvim/plugins/copilot.nix" "${userModules}/devtools/nixvim/plugins/copilot.nix"
"${userModules}/devtools/nixvim/plugins/efm.nix" "${userModules}/devtools/nixvim/plugins/efm.nix"
"${userModules}/devtools/nixvim/plugins/floaterm.nix" "${userModules}/devtools/nixvim/plugins/floaterm.nix"
"${userModules}/devtools/nixvim/plugins/harpoon.nix" "${userModules}/devtools/nixvim/plugins/harpoon.nix"
"${userModules}/devtools/nixvim/plugins/lsp.nix" "${userModules}/devtools/nixvim/plugins/lsp.nix"
"${userModules}/devtools/nixvim/plugins/lualine.nix" "${userModules}/devtools/nixvim/plugins/lualine.nix"
"${userModules}/devtools/nixvim/plugins/lightline.nix"
"${userModules}/devtools/nixvim/plugins/markdown-preview.nix" "${userModules}/devtools/nixvim/plugins/markdown-preview.nix"
"${userModules}/devtools/nixvim/plugins/neo-tree.nix" "${userModules}/devtools/nixvim/plugins/neo-tree.nix"
"${userModules}/devtools/nixvim/plugins/nonels.nix" "${userModules}/devtools/nixvim/plugins/nonels.nix"

View File

@@ -67,6 +67,7 @@ in {
formatter = "black"; formatter = "black";
}; };
nix = { nix = {
formatter = "alejandra";
linter = "statix"; linter = "statix";
}; };
lua = { lua = {
@@ -86,12 +87,24 @@ in {
css = { css = {
formatter = "prettier"; formatter = "prettier";
}; };
scss = {
formatter = "prettier";
};
ts = { ts = {
formatter = "prettier"; formatter = "prettier";
}; };
gitcommit = { gitcommit = {
linter = "gitlint"; linter = "gitlint";
}; };
php = {
formatter = "php_cs_fixer";
};
rust = {
formatter = "rustfmt";
};
sql = {
formatter = "sql-formatter";
};
}; };
}; };
}; };

View File

@@ -0,0 +1,51 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.lightline;
in {
options = {
modules.devtools.nixvim.plugins.lightline.enable = mkEnableOption "Enables lightline plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.lightline = {
enable = true;
settings = {
colorscheme = "apprentice";
active = {
right = [
[
"lineinfo"
]
[
"percent"
]
[
"fileformat"
"fileencoding"
"filetype"
]
];
};
component = {
charvaluehex = "0x%B";
lineinfo = "%3l:%-2v%<";
};
component_function = {
gitbranch = "FugitiveHead";
};
inactive = [];
mode_map = {
"<C-s>" = "SB";
"<C-v>" = "VB";
i = "I";
n = "N";
v = "V";
};
};
};
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.lsp-format;
in {
options = {
modules.devtools.nixvim.plugins.lsp-format = {
enable = mkEnableOption "Enables LSP formatting support for nixvim";
};
};
config = mkIf cfg.enable {
programs.nixvim.plugins.lsp-format = {
enable = true;
lspServersToEnable = [
"rustfmt"
"prettier"
"prettierd"
"php-cs-fixer"
"alejandra"
"xmllint"
"black"
"yamlfmt"
"stylua"
];
};
};
}

View File

@@ -13,7 +13,14 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.nixvim.plugins.lsp = { programs.nixvim.plugins = {
lsp-format = {
enable = true;
lspServersToEnable = [
"rust-analyzer"
];
};
lsp = {
enable = true; enable = true;
keymaps = { keymaps = {
@@ -65,4 +72,5 @@ in {
}; };
}; };
}; };
};
} }

View File

@@ -31,22 +31,35 @@ in {
local msg = "" local msg = ""
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients() local clients = vim.lsp.get_active_clients()
if next(clients) == nil then local non_null_ls_clients = {}
return msg
end
for _, client in ipairs(clients) do for _, client in ipairs(clients) do
if client.name ~= "null-ls" then
table.insert(non_null_ls_clients, client)
end
end
if #non_null_ls_clients > 0 then
for _, client in ipairs(non_null_ls_clients) do
local filetypes = client.config.filetypes local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name return client.name
end end
end end
else
for _, client in ipairs(clients) do
if client.name == "null-ls" then
return client.name
end
end
end
return msg return msg
end end
''; '';
icon = ""; icon = "";
color.fg = "#ffffff"; color.fg = "#A89984";
} }
"encoding"
"fileformat" "fileformat"
"filetype" "filetype"
]; ];

View File

@@ -7,7 +7,7 @@
cfg = config.modules.devtools.nixvim.plugins.neo-tree; cfg = config.modules.devtools.nixvim.plugins.neo-tree;
in { in {
options = { options = {
modules.devtools.nixvim.plugins.neo-tree.enable = mkEnableOption "Enables nix-tree plugin for nixvim"; modules.devtools.nixvim.plugins.neo-tree.enable = mkEnableOption "Enables neo-tree plugin for nixvim";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@@ -18,7 +18,7 @@ in {
closeIfLastWindow = true; closeIfLastWindow = true;
window = { window = {
width = 30; width = 30;
autoExpandWidth = true; # autoExpandWidth = true;
}; };
}; };
@@ -26,7 +26,7 @@ in {
{ {
mode = "n"; mode = "n";
key = "<leader>n"; key = "<leader>n";
action = ":neotree action=focus reveal toggle<CR>"; action = ":Neotree focus toggle<CR>";
options.silent = true; options.silent = true;
} }
]; ];

View File

@@ -32,12 +32,15 @@ in {
alejandra.enable = true; alejandra.enable = true;
stylua.enable = true; stylua.enable = true;
shfmt.enable = true; shfmt.enable = true;
nixpkgs_fmt.enable = false;
google_java_format.enable = false; google_java_format.enable = false;
prettier = { prettier = {
enable = true; enable = true;
disableTsServerFormatter = true; disableTsServerFormatter = true;
}; };
prettierd.enable = true;
phpcsfixer.enable = true;
xmllint.enable = true;
yamlfmt.enable = true;
black = { black = {
enable = true; enable = true;
settings = '' settings = ''

View File

@@ -1,6 +1,5 @@
{ {
lib, lib,
pkgs,
config, config,
... ...
}: }:
@@ -13,8 +12,17 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.nixvim = { programs.nixvim = {
plugins = { plugins.rustaceanvim = {
rustaceanvim.enable = true; enable = true;
settings.server = {
default_settings.rust-analyzer = {
cargo.features = "all";
checkOnSave = true;
check.command = "clippy";
rustc.source = "discover";
};
};
}; };
}; };
}; };

View File

@@ -1,75 +1,166 @@
{ {
modules = { modules = {
browsers = { browsers = {
firefox.enable = true; firefox = {
chromium.enable = false; enable = true;
};
chromium = {
enable = false;
};
}; };
comm = { comm = {
discord.enable = true; discord = {
enable = true;
};
}; };
devtools = { devtools = {
nixvim = { nixvim = {
enable = true; enable = true;
plugins = { plugins = {
barbar.enable = true; barbar = {
comment.enable = true; enable = false;
conform-nvim.enable = true; };
copilot.enable = false; comment = {
efm.enable = true; enable = true;
floaterm.enable = false; };
harpoon.enable = false; conform = {
lsp.enabe = true; enable = false;
lualine.enable = true; };
markdown-preview.enable = true; cmp = {
neo-tree.enable = true; enable = true;
none-ls.enable = true; };
startify.enable = true; copilot = {
tagbar.enable = false; enable = false;
telescope.enable = true; };
treesitter.enable = true; efm = {
vimtex.enable = false; enable = true;
yanky.enable = false; };
floaterm = {
enable = false;
};
harpoon = {
enable = false;
};
lsp = {
enable = true;
};
lightline = {
enable = false;
};
lualine = {
enable = true;
};
markdown-preview = {
enable = true;
};
neo-tree = {
enable = true;
};
none-ls = {
enable = false;
};
rustaceanvim = {
enable = true;
};
startify = {
enable = true;
};
tagbar = {
enable = false;
};
telescope = {
enable = true;
};
treesitter = {
enable = true;
};
vimtex = {
enable = false;
};
yanky = {
enable = false;
}; };
}; };
vscode.enable = false; };
vscode = {
enable = false;
};
}; };
gaming = { gaming = {
lutris.enable = false; lutris = {
mangohud.enable = false; enable = false;
};
mangohud = {
enable = false;
};
}; };
terminal = { terminal = {
alacritty.enable = true; alacritty = {
foot.enable = true; enable = true;
kitty.enable = true; };
zellij.enable = false; foot = {
enable = true;
};
kitty = {
enable = true;
};
zellij = {
enable = false;
};
}; };
userd = { userd = {
sops = { copyq = {
enable = false; enable = true;
adam = false; };
mako = {
enable = true;
};
udiskie = {
enable = true;
}; };
copyq.enable = true;
mako.enable = true;
udiskie.enable = true;
}; };
utils = { utils = {
ags.enable = false; ags = {
anyrun.enable = false; enable = false;
rofi.enable = false; };
waybar.enable = true; anyrun = {
yazi.enable = true; enable = false;
misc.enable = true; };
rofi = {
enable = false;
};
waybar = {
enable = true;
};
yazi = {
enable = true;
};
misc = {
enable = true;
};
}; };
wm = { wm = {
hyprland = { hyprland = {
cnst.enable = false; cnst = {
toothpick.enable = false; enable = false;
adam.enable = true; };
toothpick = {
enable = false;
};
adam = {
enable = true;
};
}; };
utils = { utils = {
hypridle.enable = true; hypridle = {
hyprlock.enable = true; enable = true;
hyprpaper.enable = true; };
hyprlock = {
enable = true;
};
hyprpaper = {
enable = true;
};
}; };
}; };
}; };

View File

@@ -5,7 +5,7 @@
enable = true; enable = true;
}; };
chromium = { chromium = {
enable = false; enable = true;
}; };
}; };
comm = { comm = {
@@ -18,12 +18,15 @@
enable = true; enable = true;
plugins = { plugins = {
barbar = { barbar = {
enable = true; enable = false;
}; };
comment = { comment = {
enable = true; enable = true;
}; };
conform-nvim = { conform = {
enable = false;
};
cmp = {
enable = true; enable = true;
}; };
copilot = { copilot = {
@@ -41,6 +44,9 @@
lsp = { lsp = {
enable = true; enable = true;
}; };
lightline = {
enable = false;
};
lualine = { lualine = {
enable = true; enable = true;
}; };
@@ -51,7 +57,7 @@
enable = true; enable = true;
}; };
none-ls = { none-ls = {
enable = true; enable = false;
}; };
rustaceanvim = { rustaceanvim = {
enable = true; enable = true;

View File

@@ -1,76 +1,166 @@
{ {
modules = { modules = {
browsers = { browsers = {
firefox.enable = true; firefox = {
chromium.enable = false; enable = true;
};
chromium = {
enable = true;
};
}; };
comm = { comm = {
discord.enable = true; discord = {
enable = true;
};
}; };
devtools = { devtools = {
nixvim = { nixvim = {
enable = true; enable = true;
plugins = { plugins = {
barbar.enable = true; barbar = {
comment.enable = true; enable = false;
conform-nvim.enable = true; };
copilot.enable = false; comment = {
efm.enable = true; enable = true;
floaterm.enable = false; };
harpoon.enable = false; conform = {
lsp.enable = true; enable = false;
lualine.enable = true; };
markdown-preview.enable = true; cmp = {
neo-tree.enable = true; enable = true;
none-ls.enable = true; };
rustaceanvim.enable = true; copilot = {
startify.enable = true; enable = false;
tagbar.enable = false; };
telescope.enable = true; efm = {
treesitter.enable = true; enable = true;
vimtex.enable = false; };
yanky.enable = false; floaterm = {
enable = false;
};
harpoon = {
enable = false;
};
lsp = {
enable = true;
};
lightline = {
enable = false;
};
lualine = {
enable = true;
};
markdown-preview = {
enable = true;
};
neo-tree = {
enable = true;
};
none-ls = {
enable = false;
};
rustaceanvim = {
enable = true;
};
startify = {
enable = true;
};
tagbar = {
enable = false;
};
telescope = {
enable = true;
};
treesitter = {
enable = true;
};
vimtex = {
enable = false;
};
yanky = {
enable = false;
}; };
}; };
vscode.enable = true; };
vscode = {
enable = true;
};
}; };
gaming = { gaming = {
lutris.enable = false; lutris = {
mangohud.enable = false; enable = false;
};
mangohud = {
enable = false;
};
}; };
terminal = { terminal = {
alacritty.enable = true; alacritty = {
foot.enable = true; enable = true;
kitty.enable = true; };
zellij.enable = false; foot = {
enable = true;
};
kitty = {
enable = true;
};
zellij = {
enable = false;
};
}; };
userd = { userd = {
sops = { copyq = {
enable = true;
};
mako = {
enable = true;
};
udiskie = {
enable = true; enable = true;
toothpick.enable = true;
}; };
copyq.enable = true;
mako.enable = true;
udiskie.enable = true;
}; };
utils = { utils = {
ags.enable = false; ags = {
anyrun.enable = false; enable = false;
rofi.enable = false; };
waybar.enable = true; anyrun = {
yazi.enable = true; enable = false;
misc.enable = true; };
rofi = {
enable = false;
};
waybar = {
enable = true;
};
yazi = {
enable = true;
};
misc = {
enable = true;
};
}; };
wm = { wm = {
hyprland = { hyprland = {
cnst.enable = false; cnst = {
toothpick.enable = true; enable = false;
adam.enable = false; };
toothpick = {
enable = true;
};
adam = {
enable = false;
};
}; };
utils = { utils = {
hypridle.enable = true; hypridle = {
hyprlock.enable = true; enable = true;
hyprpaper.enable = true; };
hyprlock = {
enable = true;
};
hyprpaper = {
enable = true;
};
}; };
}; };
}; };

View File

@@ -1,24 +1,43 @@
{ {
modules = { modules = {
gaming = { gaming = {
steam.enable = false; steam = {
gamescope.enable = false; enable = false;
lutris.enable = false; };
gamescope = {
enable = false;
};
lutris = {
enable = false;
};
gamemode = { gamemode = {
enable = false; enable = false;
optimizeGpu = false; optimizeGpu = {
enable = false;
};
}; };
}; };
gui = { gui = {
gnome.enable = false; gnome = {
hyprland.enable = true; enable = false;
};
hyprland = {
enable = true;
};
}; };
hardware = { hardware = {
bluetooth.enable = true; bluetooth = {
logitech.enable = false; enable = true;
};
logitech = {
enable = false;
};
graphics = { graphics = {
amd.enable = true; amd = {
nvidia.enable = false; enable = true;
};
nvidia = {
enable = false;
}; };
}; };
network = { network = {
@@ -30,40 +49,95 @@
}; };
}; };
}; };
};
studio = { studio = {
blender = { blender = {
enable = false; enable = false;
hip = false; hip = {
enable = false;
};
};
gimp = {
enable = false;
};
inkscape = {
enable = false;
}; };
gimp.enable = false;
inkscape.enable = false;
}; };
sysd = { sysd = {
blueman.enable = true; blueman = {
dbus.enable = true; enable = true;
fwupd.enable = true; };
gnome-keyring.enable = true; dbus = {
greetd.enable = true; enable = true;
gvfs.enable = true; };
locate.enable = true; fwupd = {
mullvad.enable = true; enable = true;
pipewire.enable = true; };
powerd.enable = true; gnome-keyring = {
samba.enable = false; enable = true;
sops = { };
enable = false; greetd = {
adampad = false; enable = true;
};
gvfs = {
enable = true;
};
locate = {
enable = true;
};
mullvad = {
enable = true;
};
pipewire = {
enable = true;
};
powerd = {
enable = true;
};
samba = {
enable = false;
};
ssh = {
enable = true;
};
udisks = {
enable = true;
};
xserver = {
amd = {
enable = true;
};
}; };
ssh.enable = true;
udisks.enable = true;
xserver.amd.enable = true;
}; };
utils = { utils = {
android.enable = true; agenix = {
anyrun.enable = true; enable = true;
corectrl.enable = false; adampad = {
microfetch.enable = true; enable = true;
nix-ld.enable = false; };
};
android = {
enable = true;
};
anyrun = {
enable = true;
};
corectrl = {
enable = false;
};
microfetch = {
enable = true;
};
nix-ld = {
enable = false;
};
misc = {
enable = true;
};
npm = {
enable = true;
};
}; };
}; };
} }

View File

@@ -36,6 +36,7 @@
./cnix ./cnix
"${mod}/boot/lanzaboote" "${mod}/boot/lanzaboote"
"${mod}/nix/nh/cnix" "${mod}/nix/nh/cnix"
"${mod}/dev"
{ {
home-manager = { home-manager = {
users.cnst.imports = homeImports."cnst@cnix"; users.cnst.imports = homeImports."cnst@cnix";
@@ -44,7 +45,6 @@
} }
inputs.chaotic.nixosModules.default inputs.chaotic.nixosModules.default
inputs.agenix.nixosModules.default inputs.agenix.nixosModules.default
(import "${mod}/dev")
]; ];
}; };
toothpc = nixosSystem { toothpc = nixosSystem {

View File

@@ -1,27 +1,44 @@
{ {
modules = { modules = {
gaming = { gaming = {
steam.enable = true; steam = {
gamescope.enable = true; enable = true;
lutris.enable = true; };
gamescope = {
enable = true;
};
lutris = {
enable = true;
};
gamemode = { gamemode = {
enable = true; enable = true;
optimizeGpu = false; optimizeGpu = {
enable = false;
};
}; };
}; };
gui = { gui = {
gnome.enable = false; gnome = {
hyprland.enable = true; enable = false;
};
hyprland = {
enable = true;
};
}; };
hardware = { hardware = {
bluetooth.enable = false; bluetooth = {
logitech.enable = true; enable = false;
};
logitech = {
enable = true;
};
graphics = { graphics = {
amd.enable = false; amd = {
enable = false;
};
nvidia = { nvidia = {
enable = true; enable = true;
package = "production"; # set to beta/stable/production depending on preference package = "production"; # set to beta/stable/production depending on your needs
};
}; };
}; };
network = { network = {
@@ -33,42 +50,95 @@
}; };
}; };
}; };
};
studio = { studio = {
blender = { blender = {
enable = false; enable = false;
hip = false; hip = {
enable = false;
};
};
gimp = {
enable = true;
};
inkscape = {
enable = true;
}; };
gimp.enable = true;
inkscape.enable = true;
}; };
sysd = { sysd = {
blueman.enable = false; blueman = {
dbus.enable = true; enable = false;
fwupd.enable = true; };
gnome-keyring.enable = true; dbus = {
greetd.enable = true; enable = true;
gvfs.enable = true; };
locate.enable = true; fwupd = {
mullvad.enable = true; enable = true;
pipewire.enable = true; };
powerd.enable = true; gnome-keyring = {
samba.enable = false; enable = true;
sops = { };
enable = true; greetd = {
toothpc.enable = true; enable = true;
};
gvfs = {
enable = true;
};
locate = {
enable = true;
};
mullvad = {
enable = true;
};
pipewire = {
enable = true;
};
powerd = {
enable = true;
};
samba = {
enable = false;
};
ssh = {
enable = true;
};
udisks = {
enable = true;
};
xserver = {
nvidia = {
enable = true;
};
}; };
ssh.enable = true;
udisks.enable = true;
xserver.nvidia.enable = true;
}; };
utils = { utils = {
android.enable = true; agenix = {
anyrun.enable = true; enable = true;
corectrl.enable = false; toothpc = {
microfetch.enable = true; enable = true;
nix-ld.enable = false; };
misc.enable = true; };
npm.enable = true; android = {
enable = false;
};
anyrun = {
enable = true;
};
corectrl = {
enable = false;
};
microfetch = {
enable = true;
};
nix-ld = {
enable = false;
};
misc = {
enable = true;
};
npm = {
enable = true;
};
}; };
}; };
} }

View File

@@ -25,6 +25,7 @@
# Other utilities and tools # Other utilities and tools
openssl # Required for some crates that involve networking or encryption openssl # Required for some crates that involve networking or encryption
alejandra alejandra
php84Packages.php-cs-fixer
# nixd # nixd
# pyright # pyright
# yaml-language-server # yaml-language-server