neovim: Migrate to nvf project

This commit is contained in:
Florian RICHER 2025-02-11 23:20:42 +01:00
parent e52f68c62a
commit d23cda3b49
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
3 changed files with 2570 additions and 89 deletions

2235
flake.lock generated

File diff suppressed because it is too large Load diff

149
flake.nix
View file

@ -57,21 +57,27 @@
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
nvf = {
url = "github:notashelf/nvf/v0.7";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{
outputs = inputs @ {
nixpkgs,
flake-utils,
home-manager,
agenix,
lanzaboote,
disko,
nvf,
...
}:
let
}: let
home-modules = with inputs; [
nix-flatpak.homeManagerModules.nix-flatpak
nix-doom-emacs.hmModule
nvf.homeManagerModules.default
];
overlays = with inputs; [
@ -79,69 +85,90 @@
nixgl.overlay
];
customNixosSystem = { name, system, extraModules ? [] }: nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./hosts/${name}/configuration.nix
home-manager.nixosModules.home-manager
agenix.nixosModules.default
lanzaboote.nixosModules.lanzaboote
disko.nixosModules.disko
{ nixpkgs.overlays = overlays; }
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs;
home-manager.users.florian.imports = home-modules ++ [
./hosts/${name}/home.nix
];
}
] ++ extraModules;
};
in {
#####################################################################
#####################################################################
# Configure all nixos configurations
#####################################################################
#####################################################################
nixosConfigurations = {
nixos-test = customNixosSystem { name = "nixos-test"; system = "x86_64-linux"; };
perso-laptop = customNixosSystem { name = "perso-laptop"; system = "x86_64-linux"; };
perso-desktop = customNixosSystem { name = "perso-desktop"; system = "x86_64-linux"; };
};
#####################################################################
#####################################################################
# Configure home configuration for all others systems like Arch Linux
#####################################################################
#####################################################################
homeConfigurations = {
perso-home = home-manager.lib.homeManagerConfiguration rec {
pkgs = import nixpkgs { system = "x86_64-linux"; inherit overlays; };
modules = home-modules ++ [
{ nix.package = pkgs.nix; }
./hosts/perso-home/home.nix
];
customNixosSystem = {
name,
system,
extraModules ? [],
}:
nixpkgs.lib.nixosSystem {
inherit system;
modules =
[
./hosts/${name}/configuration.nix
home-manager.nixosModules.home-manager
agenix.nixosModules.default
lanzaboote.nixosModules.lanzaboote
disko.nixosModules.disko
{nixpkgs.overlays = overlays;}
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs;
home-manager.users.florian.imports =
home-modules
++ [
./hosts/${name}/home.nix
];
}
]
++ extraModules;
};
};
}
#####################################################################
#####################################################################
# Configure development shell for all systems and merge with all
# previous configurations with //
#####################################################################
#####################################################################
// flake-utils.lib.eachSystem flake-utils.lib.allSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in
in
{
#####################################################################
#####################################################################
# Configure all nixos configurations
#####################################################################
#####################################################################
nixosConfigurations = {
nixos-test = customNixosSystem {
name = "nixos-test";
system = "x86_64-linux";
};
perso-laptop = customNixosSystem {
name = "perso-laptop";
system = "x86_64-linux";
};
perso-desktop = customNixosSystem {
name = "perso-desktop";
system = "x86_64-linux";
};
};
#####################################################################
#####################################################################
# Configure home configuration for all others systems like Arch Linux
#####################################################################
#####################################################################
homeConfigurations = {
perso-home = home-manager.lib.homeManagerConfiguration rec {
pkgs = import nixpkgs {
system = "x86_64-linux";
inherit overlays;
};
modules =
home-modules
++ [
{nix.package = pkgs.nix;}
./hosts/perso-home/home.nix
];
};
};
}
#####################################################################
#####################################################################
# Configure development shell for all systems and merge with all
# previous configurations with //
#####################################################################
#####################################################################
// flake-utils.lib.eachSystem flake-utils.lib.allSystems (system: let
pkgs = import nixpkgs {inherit system;};
in {
devShells = {
default = pkgs.mkShell {
packages = with pkgs; [
nixd
nil
];
};
};

View file

@ -1,41 +1,262 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.home.editors.neovim;
in
{
config,
lib,
...
}:
with lib; let
cfg = config.modules.home.editors.neovim;
in {
options.modules.home.editors.neovim = {
enable = mkEnableOption ''
Enable neovim with my custom configurations
'';
};
config = mkIf cfg.enable {
programs.neovim = {
programs.nvf = {
enable = true;
defaultEditor = true;
};
enableManpages = true;
# https://notashelf.github.io/nvf/options.html
settings.vim = {
viAlias = true;
vimAlias = true;
debugMode = {
enable = false;
level = 16;
logFile = "/tmp/nvim.log";
};
spellcheck = {
enable = true;
};
lsp = {
formatOnSave = true;
lspkind.enable = false;
lightbulb.enable = true;
lspsaga.enable = false;
trouble.enable = true;
lspSignature.enable = true;
otter-nvim.enable = true;
lsplines.enable = true;
nvim-docs-view.enable = true;
};
debugger = {
nvim-dap = {
enable = true;
ui.enable = true;
};
};
languages = {
enableLSP = true;
enableDAP = true;
enableFormat = true;
enableTreesitter = true;
enableExtraDiagnostics = true;
bash.enable = true;
clang.enable = true; # C/C++
css.enable = true;
# Not work currently. Crash during configuration of flutter-tools
# dart = {
# enable = true;
# flutter-tools = {
# enable = true;
# enableNoResolvePatch = true;
# color = {
# enable = true;
# highlightBackground = true;
# highlightForeground = true;
# virtualText.enable = true;
# };
# };
# };
html.enable = true;
java.enable = true;
kotlin.enable = true;
markdown = {
enable = true;
# extensions.render-markdown-nvim.enable = true; # Supported at the last version in dev
};
nix.enable = true;
php.enable = true;
python.enable = true;
# ruby.enable = true; # Supported at the last version in dev
rust = {
enable = true;
crates.enable = true;
};
sql.enable = true;
tailwind.enable = true;
ts = {
enable = true;
extensions.ts-error-translator.enable = false;
};
# wgsl.enable = true; # Supported at the last version in dev
zig.enable = true;
};
visuals = {
nvim-scrollbar.enable = true;
nvim-web-devicons.enable = true;
nvim-cursorline.enable = true;
cinnamon-nvim.enable = true;
fidget-nvim.enable = true;
highlight-undo.enable = true;
indent-blankline.enable = true;
# Fun
cellular-automaton.enable = false;
};
statusline = {
lualine = {
enable = true;
theme = "catppuccin";
};
};
theme = {
enable = true;
name = "catppuccin";
style = "mocha";
transparent = false;
};
autopairs.nvim-autopairs.enable = true;
autocomplete.nvim-cmp.enable = true;
snippets.luasnip.enable = true;
filetree = {
neo-tree = {
enable = true;
};
};
tabline = {
nvimBufferline.enable = true;
};
treesitter.context.enable = true;
binds = {
whichKey.enable = true;
cheatsheet.enable = true;
};
telescope.enable = true;
git = {
enable = true;
gitsigns.enable = true;
gitsigns.codeActions.enable = false; # throws an annoying debug message
};
minimap = {
minimap-vim.enable = false;
codewindow.enable = true; # lighter, faster, and uses lua for configuration
};
dashboard = {
dashboard-nvim.enable = false;
alpha.enable = true;
};
notify = {
nvim-notify.enable = true;
};
projects = {
project-nvim.enable = true;
};
utility = {
ccc.enable = false;
vim-wakatime.enable = false;
icon-picker.enable = true;
surround.enable = true;
diffview-nvim.enable = true;
# yanky-nvim.enable = false; # Supported at the last version in dev
motion = {
hop.enable = true;
leap.enable = true;
precognition.enable = false; # VIM help
};
images = {
image-nvim.enable = false;
};
};
notes = {
obsidian.enable = false; # FIXME: neovim fails to build if obsidian is enabled
neorg.enable = false;
orgmode.enable = false;
mind-nvim.enable = true;
todo-comments.enable = true;
};
terminal = {
toggleterm = {
enable = true;
lazygit.enable = true;
};
};
ui = {
borders.enable = true;
noice.enable = true;
colorizer.enable = true;
modes-nvim.enable = false; # the theme looks terrible with catppuccin
illuminate.enable = true;
breadcrumbs = {
enable = true;
navbuddy.enable = true;
};
smartcolumn = {
enable = true;
setupOpts.custom_colorcolumn = {
# this is a freeform module, it's `buftype = int;` for configuring column position
nix = "110";
ruby = "120";
java = "130";
go = ["90" "130"];
};
};
fastaction.enable = true;
};
# assistant = {
# chatgpt.enable = false;
# copilot = {
# enable = false;
# cmp.enable = true;
# };
# };
session = {
nvim-session-manager.enable = false;
};
gestures = {
gesture-nvim.enable = true;
};
comments = {
comment-nvim.enable = true;
};
presence = {
neocord.enable = true;
};
};
};
# Source : https://www.lazyvim.org/
modules.home.apps.kitty.enable = lib.mkDefault true;
modules.home.shell.git.enable = lib.mkDefault true;
home.packages = with pkgs; [
lazygit
curl
gnutar
fzf
ripgrep
fd
gcc
unzip
cargo
python3
nodejs
nil
rust-analyzer
clang-tools
];
};
}