initial commit

This commit is contained in:
Maddie H 2024-09-07 20:51:15 +01:00
commit 7081958f86
Signed by: maddie
GPG Key ID: C296DE8C9053683F
28 changed files with 1144 additions and 0 deletions

0
README.md Normal file
View File

View File

@ -0,0 +1,9 @@
{
colorschemes.onedark = {
enable = true;
settings = {
style = "darker";
transparent = false;
};
};
}

345
config/basics/keymaps.nix Normal file
View File

@ -0,0 +1,345 @@
{
keymaps = [
# Custom/special keymaps
{
mode = "n";
key = "<leader>c";
action = "<cmd>sp<CR> <cmd>term<CR> <cmd>resize 20N<CR> i";
options = {
silent = true;
desc = "Open terminal in split and resize";
};
}
{
mode = "n";
key = "<leader>h";
action = "<cmd>nohl<CR>";
options = {
silent = true;
desc = "Clear search highlight";
};
}
{
mode = "n";
key = "<leader>z";
action = "<cmd>ZenMode<CR><cmd>set wrap<CR><cmd>set linebreak<CR>";
options = {
silent = true;
desc = "Enable ZenMode with wrap and linebreak";
};
}
{
mode = "n";
key = "<leader>Z";
action = "<cmd>ZenMode<CR><cmd>set nowrap<CR><cmd>set nolinebreak<CR>";
options = {
silent = true;
desc = "Enable ZenMode without wrap and linebreak";
};
}
{
mode = "n";
key = "<C-c>";
action = "<cmd>Telescope colorscheme<CR>";
options = {
silent = true;
desc = "Open Telescope colorscheme picker";
};
}
{
mode = "n";
key = "<C-q>";
action = "<cmd>wqa<CR>";
options = {
silent = true;
desc = "Save all and quit";
};
}
{
mode = "n";
key = "<C-s>";
action = "<cmd>w<CR>";
options = {
silent = true;
desc = "Save file";
};
}
{
mode = "n";
key = "U";
action = "<cmd>redo<CR>";
options = {
silent = true;
desc = "Redo last undone change";
};
}
# Window management
{
mode = "n";
key = "<leader>vs";
action = "<cmd>vs<CR>";
options = {
silent = true;
desc = "Vertical split";
};
}
{
mode = "n";
key = "<leader>hs";
action = "<cmd>sp<CR>";
options = {
silent = true;
desc = "Horizontal split";
};
}
{
mode = "n";
key = "<leader>tn";
action = "<cmd>tabnew<CR>";
options = {
silent = true;
desc = "Open new tab";
};
}
{
mode = "n";
key = "<leader>th";
action = "<cmd>tabprev<CR>";
options = {
silent = true;
desc = "Go to previous tab";
};
}
{
mode = "n";
key = "<leader>tj";
action = "<cmd>tabprev<CR>";
options = {
silent = true;
desc = "Go to previous tab";
};
}
{
mode = "n";
key = "<leader>tk";
action = "<cmd>tabnext<CR>";
options = {
silent = true;
desc = "Go to next tab";
};
}
{
mode = "n";
key = "<leader>tl";
action = "<cmd>tabnext<CR>";
options = {
silent = true;
desc = "Go to next tab";
};
}
{
mode = "n";
key = "<leader>to";
action = "<cmd>tabo<CR>";
options = {
silent = true;
desc = "Close all other tabs";
};
}
{
mode = "n";
key = "<leader>tc";
action = "<cmd>tabc<CR>";
options = {
silent = true;
desc = "Close current tab";
};
}
# Window navigation
{
mode = "n";
key = "<C-Tab>";
action = "<C-w>w";
options = {
silent = true;
desc = "Cycle through windows";
};
}
{
mode = "n";
key = "<C-h>";
action = "<C-w>h";
options = {
silent = true;
desc = "Move to the left window";
};
}
{
mode = "n";
key = "<C-j>";
action = "<C-w>j";
options = {
silent = true;
desc = "Move to the bottom window";
};
}
{
mode = "n";
key = "<C-k>";
action = "<C-w>k";
options = {
silent = true;
desc = "Move to the top window";
};
}
{
mode = "n";
key = "<C-l>";
action = "<C-w>l";
options = {
silent = true;
desc = "Move to the right window";
};
}
# Buffer navigation
{
mode = "n";
key = "<S-l>";
action = "<cmd>bnext<CR>";
options = {
silent = true;
desc = "Go to next buffer";
};
}
{
mode = "n";
key = "<S-h>";
action = "<cmd>bprevious<CR>";
options = {
silent = true;
desc = "Go to previous buffer";
};
}
# Stay in visual mode when indenting
{
mode = "v";
key = "<";
action = "<gv";
options = {
silent = true;
desc = "Indent left and stay in visual mode";
};
}
{
mode = "v";
key = ">";
action = ">gv";
options = {
silent = true;
desc = "Indent right and stay in visual mode";
};
}
# Move by physical lines
{
mode = "n";
key = "j";
action = "gj";
options = {
silent = true;
desc = "Move down by visual line";
};
}
{
mode = "n";
key = "k";
action = "gk";
options = {
silent = true;
desc = "Move up by visual line";
};
}
# NvimTree
{
mode = "n";
key = "<C-n>";
action = "<cmd>NvimTreeToggle<CR>";
options = {
silent = true;
desc = "Toggle NvimTree";
};
}
# Telescope
{
mode = "n";
key = "<C-f>";
action = "<cmd>lua require('telescope.builtin').find_files()<CR>";
options = {
silent = true;
desc = "Find files with Telescope";
};
}
{
mode = "n";
key = "<leader>ff";
action = "<cmd>lua require('telescope.builtin').find_files()<CR>";
options = {
silent = true;
desc = "Find files with Telescope";
};
}
{
mode = "n";
key = "<leader>fg";
action = "<cmd>lua require('telescope.builtin').live_grep()<CR>";
options = {
silent = true;
desc = "Live grep with Telescope";
};
}
{
mode = "n";
key = "<leader>fb";
action = "<cmd>lua require('telescope.builtin').buffers()<CR>";
options = {
silent = true;
desc = "Search buffers with Telescope";
};
}
{
mode = "n";
key = "<leader>fh";
action = "<cmd>lua require('telescope.builtin').help_tags()<CR>";
options = {
silent = true;
desc = "Search help tags with Telescope";
};
}
# Easy alignment
{
mode = "n";
key = "ga";
action = ":EasyAlign";
options = {
silent = true;
desc = "EasyAlign in normal mode";
};
}
{
mode = "v";
key = "ga";
action = ":EasyAlign";
options = {
silent = true;
desc = "EasyAlign in visual mode";
};
}
];
}

33
config/basics/options.nix Normal file
View File

@ -0,0 +1,33 @@
{
globals = {
mapleader = " ";
};
opts = {
encoding = "utf8";
background = "dark";
relativenumber = true;
number = true;
wrap = false;
expandtab = true;
incsearch = true;
laststatus = 3;
scrolloff = 5;
tabstop = 2;
shiftwidth = 2;
cursorline = true;
ignorecase = true;
smartcase = true;
swapfile = false;
backup = false;
undofile = true;
splitbelow = true;
splitright = true;
errorbells = false;
termguicolors = true;
showmode = false;
showtabline = 1;
signcolumn = "auto";
clipboard = "unnamedplus";
mouse = "a";
};
}

40
config/default.nix Normal file
View File

@ -0,0 +1,40 @@
{
# Import all your configuration modules here
imports = [
# Basics
./basics/options.nix
./basics/keymaps.nix
./basics/colorscheme.nix
# User Interface
./ui/bufferline.nix
./ui/dashboard.nix
./ui/lualine.nix
./ui/neoscroll.nix
./ui/nvim-tree.nix
./ui/telescope.nix
./ui/zen-mode.nix
# Vim Improvements
./improvements/repeat.nix
./improvements/surround.nix
./improvements/commentary.nix
# Language
./language/autopairs.nix
./language/colorizer.nix
./language/indents.nix
./language/rainbow-delimiters.nix
# LSP, Treesitter, and Completion
./lsp/cmp.nix
./lsp/copilot.nix
./lsp/lsp.nix
./lsp/treesitter.nix
./lsp/vimtex.nix
# Git Integration
./git/neogit.nix
./git/gitsigns.nix
];
}

3
config/git/gitsigns.nix Normal file
View File

@ -0,0 +1,3 @@
{
plugins.gitsigns.enable = true;
}

3
config/git/neogit.nix Normal file
View File

@ -0,0 +1,3 @@
{
plugins.neogit.enable = true;
}

View File

@ -0,0 +1,3 @@
{
plugins.commentary.enable = true;
}

View File

@ -0,0 +1,3 @@
{
plugins.repeat.enable = true;
}

View File

@ -0,0 +1,3 @@
{
plugins.surround.enable = true;
}

View File

@ -0,0 +1,8 @@
{
plugins.nvim-autopairs = {
enable = true;
settings = {
disable_filetype = [ "TelescopePrompt" ];
};
};
}

View File

@ -0,0 +1,3 @@
{
plugins.nvim-colorizer.enable = true;
}

View File

@ -0,0 +1,17 @@
{
plugins.indent-blankline = {
enable = true;
settings = {
exclude.filetypes = [
"dashboard"
"NvimTree"
"TelescopePrompt"
"TelescopeResults"
"man"
"help"
"checkhealth"
"lspinfo"
];
};
};
}

View File

@ -0,0 +1,3 @@
{
plugins.rainbow-delimiters.enable = true;
}

71
config/lsp/cmp.nix Normal file
View File

@ -0,0 +1,71 @@
{
plugins.luasnip.enable = true;
plugins.cmp_luasnip.enable = true;
plugins.cmp = {
enable = true;
autoEnableSources = true;
settings = {
experimental = {
ghost_text = true;
};
mapping = {
"<C-j>" = "cmp.mapping.scroll_docs(4)";
"<C-k>" = "cmp.mapping.scroll_docs(-4)";
"<CR>" = ''
cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}
'';
"<Tab>" = ''
cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- elseif luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' })
'';
"<S-Tab>" = ''
cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
-- elseif luasnip.jumpable(-1) then
-- luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' })
'';
};
sources = [
{
name = "luasnip";
groupIndex = 1;
priority = 5;
max_item_count = 5;
}
{
name = "copilot";
groupIndex = 1;
priority = 4;
max_item_count = 5;
}
{
name = "nvim_lsp";
groupIndex = 1;
priority = 3;
max_item_count = 5;
}
{ name = "path"; }
{ name = "buffer"; }
{ name = "dictionary"; }
];
};
};
}

23
config/lsp/copilot.nix Normal file
View File

@ -0,0 +1,23 @@
{
plugins.copilot-lua = {
enable = true;
panel.enabled = false;
suggestion.enabled = false;
filetypes = {
yaml = false;
markdown = false;
help = false;
gitcommit = false;
gitrebase = false;
hgcommit = false;
svn = false;
cvs = false;
"." = false;
"*" = true;
};
};
plugins.copilot-cmp.enable = true;
}

59
config/lsp/lsp.nix Normal file
View File

@ -0,0 +1,59 @@
{
plugins.lsp = {
enable = true;
servers = {
# TypeScript / JavaScript
tsserver.enable = true;
# HTML
html.enable = true;
# CSS
cssls.enable = true;
# JSON
jsonls.enable = true;
# Rust
rust-analyzer = {
enable = true;
installRustc = true;
installCargo = true;
};
# Python
pyright.enable = true;
# C/C++
ccls.enable = true;
# Yaml
yamlls.enable = true;
# Lua
lua-ls.enable = true;
# Nix
nil-ls.enable = true;
};
};
plugins.lsp-format.enable = true;
autoCmd = [
{
event = [
"BufRead"
"BufNewFile"
];
pattern = [
"*.txt"
"*.md"
"*.tex"
"LICENSE"
];
command = "setlocal spell";
}
];
}

View File

@ -0,0 +1,3 @@
{
plugins.treesitter.enable = true;
}

3
config/lsp/vimtex.nix Normal file
View File

@ -0,0 +1,3 @@
{
plugins.vimtex.enable = true;
}

5
config/ui/bufferline.nix Normal file
View File

@ -0,0 +1,5 @@
{
plugins.bufferline = {
enable = false;
};
}

61
config/ui/dashboard.nix Normal file
View File

@ -0,0 +1,61 @@
{
plugins.dashboard = {
enable = true;
settings = {
change_to_vcs_root = true;
shortcut_type = "letter";
hide = {
statusline = true;
tabline = true;
};
config = {
disable_move = true;
header = [
" _ __ _ ___ "
" / | / /__ ____| | / (_)___ ___ "
" / |/ / _ \\/ __ \\ | / / / __ `__ \\"
" / /| / __/ /_/ / |/ / / / / / / /"
"/_/ |_/\\___/\\____/|___/_/_/ /_/ /_/ "
" "
];
footer = [ "NeoVim" ];
mru = {
cwd_only = true;
icon = " ";
label = "Recent Files";
limit = 10;
};
project = {
enable = true;
action = "e ";
icon = "󰉋 ";
label = "Projects";
limit = 8;
};
shortcut = [
{
icon = " ";
desc = "Open ";
key = "o";
action = "Telescope find_files";
}
{
icon = " ";
desc = "Recent ";
key = "r";
action = "Telescope oldfiles";
}
{
icon = " ";
desc = "Config ";
key = "c";
action = "e $HOME/Documents/Code/Personal/NixFiles - Personal";
}
];
};
};
};
}

5
config/ui/lualine.nix Normal file
View File

@ -0,0 +1,5 @@
{
plugins.lualine = {
enable = true;
};
}

3
config/ui/neoscroll.nix Normal file
View File

@ -0,0 +1,3 @@
{
plugins.neoscroll.enable = true;
}

18
config/ui/nvim-tree.nix Normal file
View File

@ -0,0 +1,18 @@
{
plugins.nvim-tree = {
enable = true;
disableNetrw = true;
hijackCursor = true;
selectPrompts = true;
renderer = {
fullName = true;
highlightGit = true;
};
tab.sync = {
open = true;
close = true;
};
};
}

43
config/ui/telescope.nix Normal file
View File

@ -0,0 +1,43 @@
{
plugins.telescope = {
enable = true;
keymaps = {
"<C-p>" = {
action = "git_files";
options = {
desc = "Telescope: Files";
};
};
"<leader>ff" = {
action = "git_files";
options = {
desc = "Telescope: Files";
};
};
"<leader>fF" = {
action = "find_files hidden=true";
options = {
desc = "Telescope: Files (hidden)";
};
};
"<leader>fg" = {
action = "live_grep";
options = {
desc = "Telescope: Grep";
};
};
"<leader>fG" = {
action = "live_grep hidden=true";
options = {
desc = "Telescope: Files";
};
};
};
extensions = {
fzf-native.enable = true;
media-files.enable = true;
ui-select.enable = true;
};
};
}

3
config/ui/zen-mode.nix Normal file
View File

@ -0,0 +1,3 @@
{
plugins.zen-mode.enable = true;
}

327
flake.lock Normal file
View File

@ -0,0 +1,327 @@
{
"nodes": {
"devshell": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722113426,
"narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=",
"owner": "numtide",
"repo": "devshell",
"rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-compat": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"revCount": 57,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1725234343,
"narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "567b938d64d4b4112ee253b9274472dc3a346eb6",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722555600,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": [
"nixvim",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1724857454,
"narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"nixvim",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1724435763,
"narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1724561770,
"narHash": "sha256-zv8C9RNa86CIpyHwPIVO/k+5TfM8ZbjGwOOpTe1grls=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "ac5694a0b855a981e81b4d9f14052e3ff46ca39e",
"type": "github"
},
"original": {
"owner": "lnl7",
"repo": "nix-darwin",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1725634671,
"narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1725233747,
"narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1724819573,
"narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts_2",
"git-hooks": "git-hooks",
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs_2",
"nuschtosSearch": "nuschtosSearch",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1725671303,
"narHash": "sha256-PVMrJ90B5plMxlhFUKZMYjTmBJScdTDbZ1ofrYyRQQo=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "c4135d720a5a57b7ddbd7ee918544c26b2c6f732",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1724584782,
"narHash": "sha256-7FfHv7b1jwMPSu9SPY9hdxStk8E6EeSwzqdvV69U4BM=",
"owner": "NuschtOS",
"repo": "search",
"rev": "5a08d691de30b6fc28d58ce71a5e420f2694e087",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"nixvim": "nixvim"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1724833132,
"narHash": "sha256-F4djBvyNRAXGusJiNYInqR6zIMI3rvlp6WiKwsRISos=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "3ffd842a5f50f435d3e603312eefa4790db46af5",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

47
flake.nix Normal file
View File

@ -0,0 +1,47 @@
{
description = "A nixvim configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixvim.url = "github:nix-community/nixvim";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs =
{ nixvim, flake-parts, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{ pkgs, system, ... }:
let
nixvimLib = nixvim.lib.${system};
nixvim' = nixvim.legacyPackages.${system};
nixvimModule = {
inherit pkgs;
module = import ./config; # import the module directly
# You can use `extraSpecialArgs` to pass additional arguments to your module files
extraSpecialArgs = {
# inherit (inputs) foo;
};
};
nvim = nixvim'.makeNixvimWithModule nixvimModule;
in
{
checks = {
# Run `nix flake check .` to verify that your config is not broken
default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
};
packages = {
# Lets you run `nix run .` to start nixvim
default = nvim;
};
};
};
}