Compare commits

...
Author SHA1 Message Date
5bfba070d6 fix flake 2026-07-03 23:40:37 +02:00
47401eb97f clean up nixvim config 2026-07-03 23:38:47 +02:00
6 changed files with 92 additions and 68 deletions

View file

@ -4,7 +4,7 @@
./hardware-configuration.nix ./hardware-configuration.nix
./easyroam.nix ./easyroam.nix
./stylix.nix ./stylix.nix
./nixvim.nix ./nixvim/nixvim.nix
]; ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View file

@ -38,7 +38,7 @@
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
modules = [ modules = [
./configuration.nix ./configuration.nix
./nixvim.nix ./nixvim/nixvim.nix
nix-easyroam.nixosModules.nix-easyroam nix-easyroam.nixosModules.nix-easyroam
stylix.nixosModules.stylix stylix.nixosModules.stylix
nixvim.nixosModules.nixvim nixvim.nixosModules.nixvim

View file

@ -9,7 +9,6 @@
imports = [ imports = [
./stylix.nix ./stylix.nix
inputs.nixcord.homeModules.nixcord inputs.nixcord.homeModules.nixcord
inputs.nixvim.homeModules.nixvim
]; ];
# Home Manager needs a bit of information about you and the # Home Manager needs a bit of information about you and the
# paths it should manage. # paths it should manage.

29
nixvim/keymaps.nix Normal file
View file

@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
}:
{
programs.nixvim = {
keymaps = [
{
key = "<C-f>";
action = "<cmd> lua vim.lsp.buf.format() <cr>";
}
{
key = "<leader>t";
action = "<cmd> terminal <cr>";
}
{
key = "<esc>";
action = "<c-\\><c-n>";
mode = "t";
}
{
key = "<leader-w>";
action = "<cmd> lua bdelete! <cr>";
}
];
};
}

59
nixvim/nixvim.nix Normal file
View file

@ -0,0 +1,59 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./plugins.nix
./keymaps.nix
];
programs.nixvim = {
enable = true;
extraConfigLuaPost = ''
local map = vim.keymap.set
for i = 1, 10 do
map('n', '<A-' .. i .. '>', '<cmd> LualineBuffersJump! ' .. i .. '<cr>')
end
'';
opts = {
relativenumber = true;
tabstop = 8;
shiftwidth = 8;
expandtab = true;
swapfile = false;
};
extraPackages = with pkgs; [
nixfmt
];
lsp = {
inlayHints.enable = true;
servers = {
clangd.enable = true;
qmlls.enable = true;
lua-language-server.enable = true;
rust_analyzer.enable = true;
nixd = {
enable = true;
config = {
formatting = {
command = "nixfmt";
};
};
};
};
};
globals = {
mapleader = " ";
};
diagnostic = {
settings = {
virtual_text = {
spacing = 4;
source = true;
};
};
};
};
}

View file

@ -1,45 +1,11 @@
{ {
config,
lib, lib,
config,
pkgs, pkgs,
... ...
}: }:
{ {
programs.nixvim = { programs.nixvim = {
enable = true;
extraConfigLuaPost = ''
local map = vim.keymap.set
for i = 1, 10 do
map('n', '<A-' .. i .. '>', '<cmd> LualineBuffersJump! ' .. i .. '<cr>')
end
'';
opts = {
relativenumber = true;
tabstop = 8;
shiftwidth = 8;
expandtab = true;
swapfile = false;
};
extraPackages = with pkgs; [
nixfmt
];
lsp = {
inlayHints.enable = true;
servers = {
clangd.enable = true;
qmlls.enable = true;
lua-language-server.enable = true;
rust_analyzer.enable = true;
nixd = {
enable = true;
config = {
formatting = {
command = "nixfmt";
};
};
};
};
};
plugins = { plugins = {
lspconfig.enable = true; lspconfig.enable = true;
blink-cmp = { blink-cmp = {
@ -102,35 +68,6 @@
}; };
}; };
}; };
globals = {
mapleader = " ";
};
diagnostic = {
settings = {
virtual_text = {
spacing = 4;
source = true;
};
};
};
keymaps = [
{
key = "<C-f>";
action = "<cmd> lua vim.lsp.buf.format() <cr>";
}
{
key = "<leader>t";
action = "<cmd> terminal <cr>";
}
{
key = "<esc>";
action = "<c-\\><c-n>";
mode = "t";
}
{
key = "<leader-w>";
action = "<cmd> lua bdelete! <cr>";
}
];
}; };
} }