nixbook: nixvim
nixbook: add more nixvim plugins
This commit is contained in:
parent
ce02fb7bee
commit
88ce520e29
9 changed files with 470 additions and 193 deletions
259
flake.lock
generated
259
flake.lock
generated
|
|
@ -114,6 +114,27 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
@ -131,6 +152,20 @@
|
|||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"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-compat_3": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1673956053,
|
||||
|
|
@ -146,6 +181,45 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719994518,
|
||||
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"fromYaml": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
@ -162,6 +236,58 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
"nixvim",
|
||||
"flake-compat"
|
||||
],
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-stable": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1721042469,
|
||||
"narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "f451c19376071a90d8c58ab1a953c6e9840527fd",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"gnome-shell": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
@ -201,6 +327,27 @@
|
|||
}
|
||||
},
|
||||
"home-manager_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722119539,
|
||||
"narHash": "sha256-2kU90liMle0vKR8exJx1XM4hZh9CdNgZGHCTbeA9yzY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "d0240a064db3987eb4d5204cf2400bc4452d9922",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager_3": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"stylix",
|
||||
|
|
@ -221,6 +368,27 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722082646,
|
||||
"narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-cosmic": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
|
|
@ -322,11 +490,62 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixvim": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-parts": "flake-parts",
|
||||
"git-hooks": "git-hooks",
|
||||
"home-manager": "home-manager_2",
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"nuschtosSearch": "nuschtosSearch",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722248209,
|
||||
"narHash": "sha256-yYoxx5hVrI7JaiPy44sgnr5YIRXWY7ttNoN/l5fJOgI=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "2089eb407d8c5dbd6ca6e93d4988a439ca6446fd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nuschtosSearch": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722144272,
|
||||
"narHash": "sha256-olZbfaEdd+zNPuuyYcYGaRzymA9rOmth8yXOlVm+LUs=",
|
||||
"owner": "NuschtOS",
|
||||
"repo": "search",
|
||||
"rev": "16565307c267ec219c2b5d3494ba66df08e7d403",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NuschtOS",
|
||||
"repo": "search",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nixos-cosmic": "nixos-cosmic",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixvim": "nixvim",
|
||||
"sops-nix": "sops-nix",
|
||||
"stylix": "stylix"
|
||||
}
|
||||
|
|
@ -359,9 +578,9 @@
|
|||
"base16-kitty": "base16-kitty",
|
||||
"base16-tmux": "base16-tmux",
|
||||
"base16-vim": "base16-vim",
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-compat": "flake-compat_3",
|
||||
"gnome-shell": "gnome-shell",
|
||||
"home-manager": "home-manager_2",
|
||||
"home-manager": "home-manager_3",
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
|
|
@ -377,6 +596,42 @@
|
|||
"repo": "stylix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"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": 1721769617,
|
||||
"narHash": "sha256-6Pqa0bi5nV74IZcENKYRToRNM5obo1EQ+3ihtunJ014=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "8db8970be1fb8be9c845af7ebec53b699fe7e009",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
|
|
|||
69
flake.nix
69
flake.nix
|
|
@ -12,9 +12,13 @@
|
|||
url = "github:lilyinstarlight/nixos-cosmic";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nixvim = {
|
||||
url = "github:nix-community/nixvim";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs: let
|
||||
outputs = {nixvim, ...} @ inputs: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = import inputs.nixpkgs {inherit system;};
|
||||
user = "tristan";
|
||||
|
|
@ -25,14 +29,15 @@
|
|||
in {
|
||||
formatter.${system} = pkgs.alejandra;
|
||||
nixosConfigurations = {
|
||||
zenix =
|
||||
mkConf [
|
||||
zenix = mkConf {
|
||||
nixos-modules = [
|
||||
./hardware/zenix.nix
|
||||
(auto-login "Hyprland")
|
||||
./nixos/programs/gamer.nix
|
||||
./nixos/programs/personal.nix
|
||||
./nixos/workstation.nix
|
||||
] [
|
||||
];
|
||||
home-modules = [
|
||||
./home/workstation.nix
|
||||
./home/desktop/hyprland/.
|
||||
./home/programs/graphical.nix
|
||||
|
|
@ -40,21 +45,25 @@
|
|||
./home/programs/personal/.
|
||||
./home/programs/xr.nix
|
||||
];
|
||||
};
|
||||
|
||||
FCS-Tristan-Nixbook =
|
||||
mkConf [
|
||||
FCS-Tristan-Nixbook = mkConf {
|
||||
nixos-modules = [
|
||||
./hardware/fcs-tristan-nixbook.nix
|
||||
(auto-login "Hyprland")
|
||||
./nixos/modules/work.nix
|
||||
./nixos/workstation.nix
|
||||
] [
|
||||
];
|
||||
home-modules = [
|
||||
./home/workstation.nix
|
||||
./home/desktop/hyprland/.
|
||||
./home/programs/work.nix
|
||||
./home/programs/graphical.nix
|
||||
];
|
||||
};
|
||||
|
||||
alpine = mkConf [
|
||||
alpine = mkConf {
|
||||
nixos-modules = [
|
||||
./hardware/alpine.nix
|
||||
./nixos/services/anki.nix
|
||||
./nixos/services/forgejo.nix
|
||||
|
|
@ -70,7 +79,8 @@
|
|||
./nixos/services/ntfy.nix
|
||||
./nixos/services/authentik.nix
|
||||
./nixos/services/monero.nix
|
||||
] [];
|
||||
];
|
||||
};
|
||||
|
||||
vm-sway =
|
||||
builtins.trace ''
|
||||
|
|
@ -80,24 +90,30 @@
|
|||
start the vm with '-vga qxl' or '-vga virtio'
|
||||
''
|
||||
mkConf
|
||||
[
|
||||
{
|
||||
nixos-modules = [
|
||||
./hardware/vm.nix
|
||||
(auto-login "sway")
|
||||
./nixos/workstation.nix
|
||||
] [
|
||||
];
|
||||
home-modules = [
|
||||
./home/desktop/sway/.
|
||||
./home/workstation.nix
|
||||
];
|
||||
};
|
||||
|
||||
vm-cosmic =
|
||||
mkConf
|
||||
[
|
||||
{
|
||||
nixos-modules = [
|
||||
./hardware/vm.nix
|
||||
./nixos/workstation.nix
|
||||
./nixos/programs/cosmic.nix
|
||||
] [
|
||||
];
|
||||
home-modules = [
|
||||
./home/workstation.nix
|
||||
];
|
||||
};
|
||||
|
||||
vm-hyprland =
|
||||
builtins.trace ''
|
||||
|
|
@ -109,18 +125,37 @@
|
|||
start with '-vga virtio'
|
||||
''
|
||||
mkConf
|
||||
[
|
||||
{
|
||||
nixos-modules = [
|
||||
./hardware/vm.nix
|
||||
(auto-login "Hyprland")
|
||||
./nixos/workstation.nix
|
||||
] [
|
||||
];
|
||||
home-modules = [
|
||||
./home/desktop/hyprland/.
|
||||
./home/workstation.nix
|
||||
];
|
||||
};
|
||||
|
||||
vm-tty = mkConf [
|
||||
vm-tty =
|
||||
mkConf
|
||||
{
|
||||
nixos-modules = [
|
||||
./hardware/vm.nix
|
||||
] [];
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
packages.${system} = {
|
||||
nixvim = let
|
||||
nixvim' = nixvim.legacyPackages.${system};
|
||||
nixvimModule = {
|
||||
inherit pkgs;
|
||||
module = import ./lib/nixvim.nix;
|
||||
};
|
||||
nvim = nixvim'.makeNixvimWithModule nixvimModule;
|
||||
in
|
||||
nvim;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
text = config.lib.stylix.colors.base05;
|
||||
};
|
||||
rgb = color: "rgb(${color})";
|
||||
|
||||
in {
|
||||
imports = [
|
||||
(import ../utils/waybar.nix)
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
vim.o.relativenumber = true
|
||||
vim.o.number = true
|
||||
vim.o.signcolumn = 'yes'
|
||||
vim.o.tabstop = 2
|
||||
vim.o.shiftwidth = 2
|
||||
vim.o.expandtab = true
|
||||
vim.o.smartindent = true
|
||||
vim.o.scrolloff = 4
|
||||
vim.o.undofile = true
|
||||
vim.o.undodir = vim.fn.expand("$HOME/.local/share/nvim/undo")
|
||||
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
vim.keymap.set("x", "p", "\"_dP")
|
||||
|
||||
vim.keymap.set("n", "<leader>y", "\"+y")
|
||||
vim.keymap.set("v", "<leader>y", "\"+y")
|
||||
|
||||
-- Global mappings.
|
||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
||||
|
||||
vim.keymap.set('v', '<C-c>', '"+y')
|
||||
vim.keymap.set('i', '<C-v>', '<escape>"+p')
|
||||
|
|
@ -1,56 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
programs.neovim = {
|
||||
programs.nixvim =
|
||||
{
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
extraLuaConfig = ''
|
||||
${builtins.readFile ./config.lua}
|
||||
'';
|
||||
extraPackages = with pkgs; [
|
||||
nodePackages_latest.typescript-language-server
|
||||
vscode-langservers-extracted
|
||||
gopls
|
||||
nil
|
||||
rust-analyzer
|
||||
];
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-surround;
|
||||
type = "lua";
|
||||
config = ''
|
||||
require("nvim-surround").setup()
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = comment-nvim;
|
||||
type = "lua";
|
||||
config = ''
|
||||
require("Comment").setup()
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = vimwiki;
|
||||
config = ''
|
||||
let g:vimwiki_list = [{'path': '~/Documents/vimwiki/', 'syntax': 'markdown', 'ext': '.md'}]
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = telescope-nvim;
|
||||
type = "lua";
|
||||
config = ''
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = nvim-lspconfig;
|
||||
type = "lua";
|
||||
config = builtins.readFile ./lspconfig.lua;
|
||||
}
|
||||
];
|
||||
};
|
||||
// import ../../../lib/nixvim.nix;
|
||||
|
||||
programs.vscode = {
|
||||
extensions = [pkgs.vscode-extensions.asvetliakov.vscode-neovim];
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
-- Setup language servers.
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
local on_attach = function(client)
|
||||
require'completion'.on_attach(client)
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
end
|
||||
|
||||
lspconfig.tsserver.setup {
|
||||
on_attach = on_attach
|
||||
}
|
||||
|
||||
lspconfig.eslint.setup {
|
||||
on_attach = on_attach
|
||||
}
|
||||
|
||||
lspconfig.rust_analyzer.setup {
|
||||
on_attach = on_attach
|
||||
}
|
||||
|
||||
lspconfig.gopls.setup {}
|
||||
lspconfig.nil_ls.setup {}
|
||||
lspconfig.rust_analyzer.setup {}
|
||||
|
||||
-- Use LspAttach autocommand to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf }
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
vim.keymap.set('n', '<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts)
|
||||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
||||
vim.keymap.set('n', '<leader>f', function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, opts)
|
||||
end,
|
||||
})
|
||||
|
|
@ -4,8 +4,11 @@
|
|||
user,
|
||||
userFullname,
|
||||
...
|
||||
}: modules: home-modules: let
|
||||
inherit (inputs) home-manager nixpkgs sops-nix;
|
||||
}: {
|
||||
nixos-modules ? [],
|
||||
home-modules ? [],
|
||||
}: let
|
||||
inherit (inputs) home-manager nixpkgs sops-nix nixvim;
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs;};
|
||||
|
|
@ -13,9 +16,8 @@ in
|
|||
inherit system;
|
||||
|
||||
modules =
|
||||
modules
|
||||
nixos-modules
|
||||
++ [
|
||||
../nixos/modules/podman.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
sops-nix.nixosModules.sops
|
||||
{
|
||||
|
|
@ -25,6 +27,7 @@ in
|
|||
users.${user}.imports =
|
||||
home-modules
|
||||
++ [
|
||||
nixvim.homeManagerModules.nixvim
|
||||
../home/.
|
||||
{
|
||||
options.home.userFullname = nixpkgs.lib.mkOption {default = userFullname;};
|
||||
|
|
|
|||
106
lib/nixvim.nix
Normal file
106
lib/nixvim.nix
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
};
|
||||
opts = {
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
tabstop = 2;
|
||||
shiftwidth = 2;
|
||||
expandtab = true;
|
||||
smartindent = true;
|
||||
scrolloff = 4;
|
||||
|
||||
undofile = true;
|
||||
};
|
||||
extraConfigLua = ''
|
||||
vim.o.undodir = vim.fn.expand("$HOME/.local/share/nvim/undo")
|
||||
'';
|
||||
keymaps = [
|
||||
{
|
||||
key = "<C-c>";
|
||||
action = ''"+y'';
|
||||
}
|
||||
{
|
||||
key = "gl";
|
||||
action = "g$";
|
||||
}
|
||||
{
|
||||
key = "gh";
|
||||
action = "g0";
|
||||
}
|
||||
{
|
||||
key = "<leader>ggs";
|
||||
action = ":Gitsigns stage_hunk<CR>";
|
||||
}
|
||||
{
|
||||
key = "<leader>ggb";
|
||||
action = ":Gitsigns blame<CR>";
|
||||
}
|
||||
{
|
||||
key = "<leader>ggg";
|
||||
action = ":LazyGit<CR>";
|
||||
}
|
||||
];
|
||||
|
||||
plugins = {
|
||||
bufferline.enable = true;
|
||||
surround.enable = true;
|
||||
comment.enable = true;
|
||||
|
||||
markdown-preview.enable = true;
|
||||
treesitter.enable = true;
|
||||
|
||||
telescope = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
"<leader>fg" = "live_grep";
|
||||
"<leader>/" = "live_grep";
|
||||
"<leader>ff" = "find_files";
|
||||
"<leader>fb" = "buffers";
|
||||
"<leader>fh" = "help_tags";
|
||||
"<leader>:" = "commands";
|
||||
};
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
tsserver.enable = true;
|
||||
nixd.enable = true;
|
||||
};
|
||||
keymaps = {
|
||||
lspBuf = {
|
||||
"K" = "hover";
|
||||
"<leader>a" = "code_action";
|
||||
"gd" = "definition";
|
||||
};
|
||||
diagnostic = {
|
||||
"<leader>e" = "open_float";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
};
|
||||
|
||||
cmp-nvim-lsp.enable = true;
|
||||
cmp-path.enable = true;
|
||||
|
||||
ts-autotag.enable = true;
|
||||
|
||||
gitsigns.enable = true;
|
||||
git-worktree = {
|
||||
enable = true;
|
||||
enableTelescope = true;
|
||||
};
|
||||
lazygit.enable = true;
|
||||
which-key.enable = true;
|
||||
toggleterm = {
|
||||
enable = true;
|
||||
settings = {open_mapping = "[[<c-`>]]";};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -8,6 +8,11 @@
|
|||
}: let
|
||||
user = config.user;
|
||||
in {
|
||||
|
||||
imports = [
|
||||
./modules/podman.nix
|
||||
];
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
|
|
@ -113,10 +118,15 @@ in {
|
|||
bind -n M-+ resize-pane -U 10
|
||||
bind -n M-u copy-mode
|
||||
bind -n M-p paste-buffer
|
||||
bind -n M-n next-window
|
||||
|
||||
set-window-option -g mode-keys vi
|
||||
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind-key -T copy-mode-vi y send-keys -X copy-selection
|
||||
|
||||
set -g mouse on
|
||||
|
||||
bind -n "M-`" break-pane -d
|
||||
'';
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue