Added nixvim

This commit is contained in:
2025-04-10 11:26:13 +02:00
parent 5b6f8916f8
commit a82e6c87e0
16 changed files with 478 additions and 30 deletions

View File

@@ -6,7 +6,6 @@
./modules/boot.nix
./modules/nvidia.nix
./modules/services.nix
./modules/styling.nix
];
nix.gc = {
@@ -80,18 +79,16 @@
appimage-run
btop
busybox
cmake
distrobox
docker
fish
fzf
gcc
git
gnumake
htop
jq
killall
md2pdf
nmap
python3
ripgrep
tree
@@ -109,34 +106,30 @@
man-pages
vim # The only and one great editor
neovim # The only and one great editor improved even further
# neovim # The only and one great editor improved even further
# Video card
vulkan-tools
# Gaming
dolphin-emu
gamemode
gamescope
heroic
mangohud
prismlauncher
steam
vesktop
# Desktop utils
brave
kitty
mpv
xdg-desktop-portal
xdg-desktop-portal-gtk
xdg-desktop-portal-kde
# GUI applications
baobab
# ciscoPacketTracer8 # Every time this application fucks up
brave
kdePackages.xdg-desktop-portal-kde
kitty
libreoffice
mpv
spotube
telegram-desktop
xdg-desktop-portal
xdg-desktop-portal-gtk
# LSPs
gopls # .go
@@ -150,9 +143,6 @@
virtualisation.podman.enable = true;
virtualisation.podman.dockerCompat = true;
virtualisation.vmware.host.enable = true;
# virtualisation.virtualbox.host.enable = true;
# virtualisation.virtualbox.host.enableExtensionPack = true;
# users.extraGroups.vboxusers.members = [ "r3ddy" ];
system.stateVersion = "24.05"; # Did you read the comment?
}

143
flake.lock generated
View File

@@ -1,5 +1,44 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -7,27 +46,54 @@
]
},
"locked": {
"lastModified": 1740207313,
"narHash": "sha256-JX1m0cY2g2Kl5HvIgyJn/KBbuU/e8j0Vfifua/FtF84=",
"lastModified": 1744208565,
"narHash": "sha256-vG3JJOar/r8ognz7wuwMtOJ8Knu1MMlOzHB1N6R2MbY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f0f0d1ade22b51eaaf4d16e6b3f4990d8c348f3e",
"rev": "542efdf2dfac351498f534eb71671525b9bd45ed",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "home-manager",
"type": "github"
}
},
"ixx": {
"inputs": {
"flake-utils": [
"nixvim",
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nixvim",
"nuschtosSearch",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729958008,
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.0.6",
"repo": "ixx",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1739866667,
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
"lastModified": 1744098102,
"narHash": "sha256-tzCdyIJj9AjysC3OuKA+tMD/kDEDAF9mICPDU7ix0JA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
"rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7",
"type": "github"
},
"original": {
@@ -37,10 +103,71 @@
"type": "github"
}
},
"nixvim": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": [
"nixpkgs"
],
"nuschtosSearch": "nuschtosSearch"
},
"locked": {
"lastModified": 1744200902,
"narHash": "sha256-BqTLjxT1C1XfREDBQSxPrfKI9DBpZHBVLHzfXZs+h8M=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "51203927e395535c4a427295efed4e1b2ef8349b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1743683223,
"narHash": "sha256-LdXtHFvhEC3S64dphap1pkkzwjErbW65eH1VRerCUT0=",
"owner": "NuschtOS",
"repo": "search",
"rev": "56a49ffef2908dad1e9a8adef1f18802bc760962",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
"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"
}
}
},

View File

@@ -4,14 +4,21 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/master";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
outputs = { self, nixpkgs, home-manager, nixvim, ... }@inputs:
let
system = "x86_64-linux";
in
{
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
@@ -20,6 +27,10 @@
home-manager.backupFileExtension = "backup";
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = [
nixvim.homeManagerModules.nixvim
];
home-manager.users.r3ddy = import ./home;
}
];

View File

@@ -1,6 +1,7 @@
{ ... }:
{
imports = [
./nvim
./tmux.nix
./fish.nix
./git.nix

26
home/nvim/cmp.nix Normal file
View File

@@ -0,0 +1,26 @@
{ ... }:
{
programs.nixvim.plugins.lspkind.enable = true;
programs.nixvim.plugins.cmp-nvim-lsp-signature-help.enable = true;
programs.nixvim.plugins.cmp = {
enable = true;
autoEnableSources = true;
settings = {
sources = [
{ name = "nvim_lsp"; }
{ name = "nvim_lsp_signature_help"; }
{ name = "path"; }
{ name = "buffer"; }
];
mapping = {
"<Tab>" = "cmp.mapping.select_next_item()";
"<S-Tab>" = "cmp.mapping.select_prev_item()";
"<C-j>" = "cmp.mapping.scroll_docs(4)";
"<C-k>" = "cmp.mapping.scroll_docs(-4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-Esc>" = "cmp.mapping.close()";
"<CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })";
};
};
};
}

23
home/nvim/default.nix Normal file
View File

@@ -0,0 +1,23 @@
{ pkgs, ... }:
{
imports = [
./opts.nix
./lsp.nix
./cmp.nix
./keymaps.nix
./plugins
];
programs.nixvim = {
enable = true;
colorschemes.catppuccin.enable = true;
extraPackages = with pkgs; [
wl-clipboard
];
clipboard.register = "unnamedplus";
clipboard.providers.wl-copy.enable = true;
clipboard.providers.wl-copy.package = pkgs.wl-clipboard;
clipboard.providers.xclip.enable = true;
clipboard.providers.xclip.package = pkgs.xclip;
};
}

133
home/nvim/keymaps.nix Normal file
View File

@@ -0,0 +1,133 @@
{ ... }:
{
programs.nixvim.keymaps = [
{
action = ":bnext<CR>";
key = "<A-l>";
options = {
silent = true;
desc = "Next tab";
};
mode = "n";
}
{
action = ":bprevious<CR>";
key = "<A-h>";
options = {
silent = true;
desc = "Previous tab";
};
mode = "n";
}
{
action = ":bdelete<CR>";
key = "<S-q>";
options = {
silent = true;
desc = "Next tab";
};
mode = "n";
}
{
action = "<C-\\><C-n>";
key = "<Esc>";
options = {
silent = true;
desc = "Exit terminal insert mode";
};
mode = "t";
}
{
action = ":w<CR>";
key = "<C-s>";
options = {
silent = true;
desc = "Save";
};
mode = "n";
}
{
action = ":q<CR>";
key = "<C-q>";
options = {
silent = true;
desc = "Quit";
};
mode = "n";
}
{
action = ":wincmd l<CR>";
key = "<Space>wl";
options = {
silent = true;
desc = "Go to left panel";
};
mode = "n";
}
{
action = ":wincmd k<CR>";
key = "<Space>wk";
options = {
silent = true;
desc = "Go to upper panel";
};
mode = "n";
}
{
action = ":wincmd j<CR>";
key = "<Space>wj";
options = {
silent = true;
desc = "Go to down panel";
};
mode = "n";
}
{
action = ":wincmd h<CR>";
key = "<Space>wh";
options = {
silent = true;
desc = "Go to left panel";
};
mode = "n";
}
{
action = "$";
key = "gl";
options = {
silent = true;
desc = "Go to end line";
};
mode = [ "n" "v" ];
}
{
action = "^";
key = "gh";
options = {
silent = true;
desc = "Go to start line";
};
mode = [ "n" "v" ];
}
# Neotree
{
action = ":Neotree toggle<CR>";
key = "<Space>e";
options = {
silent = true;
desc = "Toggle file explorer";
};
mode = "n";
}
# ToggleTerm
{
action = ":ToggleTerm direction=float<CR>";
key = "<Space>t";
options = {
silent = true;
desc = "Toggle terminal";
};
mode = "n";
}
];
}

31
home/nvim/lsp.nix Normal file
View File

@@ -0,0 +1,31 @@
{ ... }:
{
programs.nixvim.plugins.lsp = {
enable = true;
servers = {
clangd.enable = true;
nil_ls.enable = true;
gopls.enable = true;
jdtls.enable = true;
lua_ls.enable = true;
rust_analyzer = {
enable = true;
installCargo = true;
installRustc = true;
installRustfmt = true;
};
zls.enable = true;
nim_langserver.enable = true;
pylsp.enable = true;
emmet_language_server.enable = true;
ts_ls.enable = true;
};
keymaps = {
lspBuf = {
"<Space>k" = "hover";
"<Space>r" = "rename";
"<Space>a" = "code_action";
};
};
};
}

17
home/nvim/opts.nix Normal file
View File

@@ -0,0 +1,17 @@
{ ... }:
{
programs.nixvim.opts = {
number = true;
relativenumber = true;
signcolumn = "yes";
splitright = true;
splitbelow = true;
cursorline = true;
scrolloff = 5;
undofile = true;
ignorecase = true;
smartcase = true;
gdefault = true;
termguicolors = true;
};
}

View File

@@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim.plugins.comment = {
enable = true;
settings.toggler = {
block = "<C-x>";
line = "<C-c>";
};
};
}

View File

@@ -0,0 +1,20 @@
{ ... }:
{
programs.nixvim.plugins.dashboard = {
enable = true;
settings.config = {
header = [
" "
" "
" "
" "
" "
" "
" "
" "
" "
];
footer = [ "Made with " ];
};
};
}

View File

@@ -0,0 +1,22 @@
{ ... }:
{
imports = [
./telescope.nix
./treesitter.nix
./comment.nix
./lualine.nix
./dashboard.nix
./neotree.nix
];
programs.nixvim.plugins = {
web-devicons.enable = true;
bufferline.enable = true;
toggleterm.enable = true;
gitsigns.enable = true;
which-key.enable = true;
autoclose.enable = true;
markview.enable = true;
nvim-surround.enable = true;
};
}

View File

@@ -0,0 +1,6 @@
{ ... }:
{
programs.nixvim.plugins.lualine = {
enable = true;
};
}

View File

@@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim.plugins.neo-tree = {
enable = true;
window = {
width = 30;
};
};
}

View File

@@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim.plugins.telescope = {
enable = true;
keymaps = {
"<Space>f" = "find_files";
"<Space>g" = "live_grep";
};
};
}

View File

@@ -0,0 +1,11 @@
{ ... }:
{
programs.nixvim.plugins.treesitter = {
enable = true;
settings = {
highlight = {
enable = true;
};
};
};
}