neovim: add a bunch of configuration

This commit is contained in:
Anthony Rodriguez 2024-09-24 23:47:40 +02:00
parent 402926b78b
commit 9078b65d49
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
5 changed files with 84 additions and 81 deletions

View file

@ -683,11 +683,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1727149466, "lastModified": 1727186381,
"narHash": "sha256-xOZq7IhHrkLhjdhfcdaDY4Ru2o0C9jtuoEpUtGGFYJE=", "narHash": "sha256-T6vSJAvbYSBsaUkwh2adbIt7liE2xpcRhmlosMNZnDo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "901346e38b81c236305e29934dd02c1f64bd8621", "rev": "8f991cc8bc417ddbd1d5c7732268255557c13f4a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -848,11 +848,11 @@
"systems": "systems_3" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1727148426, "lastModified": 1727179231,
"narHash": "sha256-R0mIsBwxtX6i54XvM02JXTAq5xmbmOvYyGWc5GiOIxI=", "narHash": "sha256-Jm9w3lBmX5D2IKhmpGUvb4XXEK8h3rqGv1LETphJEiY=",
"owner": "notashelf", "owner": "notashelf",
"repo": "nvf", "repo": "nvf",
"rev": "316f25a0f62696b289ad4b944789beaae7fa9415", "rev": "8e96f0aaa325b992d17a3e7c9613344680375791",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1985,11 +1985,11 @@
"plugin-nvim-treesitter-context": { "plugin-nvim-treesitter-context": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1716388265, "lastModified": 1726947805,
"narHash": "sha256-EY5Si6t7LXcxOP3ubGAAMd3lgbeaCOCIybSKi1Ucx98=", "narHash": "sha256-5oN/vyhSqDqjLEzECj01A7A+Yq7U1H1HXLbzkC1Ljqw=",
"owner": "nvim-treesitter", "owner": "nvim-treesitter",
"repo": "nvim-treesitter-context", "repo": "nvim-treesitter-context",
"rev": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683", "rev": "3d5390c49e3f8fe457b376df2a49aa39d75b7911",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,17 +1,14 @@
{ {
description = "nezia's nixos configuration"; description = "nezia's nixos configuration";
outputs = outputs = {
{
nixpkgs, nixpkgs,
home-manager, home-manager,
nixvim, nixvim,
nvf,
sops-nix, sops-nix,
stylix, stylix,
... ...
}@inputs: } @ inputs: let
let
username = "nezia"; username = "nezia";
system = "x86_64-linux"; system = "x86_64-linux";
@ -24,14 +21,16 @@
stylix.nixosModules.stylix stylix.nixosModules.stylix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager = {
home-manager.useUserPackages = true; useGlobalPkgs = true;
home-manager.sharedModules = [ useUserPackages = true;
sharedModules = [
nixvim.homeManagerModules.nixvim nixvim.homeManagerModules.nixvim
]; ];
home-manager.extraSpecialArgs = { extraSpecialArgs = {
inherit inputs system; inherit inputs system;
}; };
};
} }
{ {
_module.args = { _module.args = {
@ -40,17 +39,15 @@
} }
]; ];
configureSystem = configureSystem = hostname: homeConfig:
hostname: homeConfig:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
system = system; inherit system;
modules = commonModules hostname ++ [{home-manager.users."${username}" = import homeConfig;}]; modules = commonModules hostname ++ [{home-manager.users."${username}" = import homeConfig;}];
specialArgs = { specialArgs = {
inherit inputs; inherit inputs;
}; };
}; };
in in {
{
nixosConfigurations = { nixosConfigurations = {
vamos = configureSystem "vamos" ./home/laptop; vamos = configureSystem "vamos" ./home/laptop;
solaire = configureSystem "solaire" ./home/desktop; solaire = configureSystem "solaire" ./home/desktop;

View file

@ -2,7 +2,6 @@ _: {
imports = [ imports = [
./git.nix ./git.nix
./gnupg.nix ./gnupg.nix
# ./wezterm.nix
./browsers.nix ./browsers.nix
./miscellaneous.nix ./miscellaneous.nix
]; ];

View file

@ -1,6 +1,4 @@
{ inputs, ... }: {inputs, ...}: {
{
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
inputs.nixos-hardware.nixosModules.framework-13-7040-amd inputs.nixos-hardware.nixosModules.framework-13-7040-amd
@ -21,5 +19,8 @@
}; };
}; };
}; };
modules.neovim.enable = true; modules = {
neovim.enable = true;
wezterm.enable = true;
};
} }

View file

@ -5,11 +5,9 @@
pkgs, pkgs,
username, username,
... ...
}: }: let
let
cfg = config.modules.neovim; cfg = config.modules.neovim;
in in {
{
options.modules.neovim.enable = lib.mkEnableOption "neovim"; options.modules.neovim.enable = lib.mkEnableOption "neovim";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -39,25 +37,40 @@ in
'' ''
]; ];
maps = {
normal = {
"<leader>m" = {
silent = true;
action = "<cmd>make<CR>";
}; # Same as nnoremap <leader>m <silent> <cmd>make<CR>
"<leader>t" = {
silent = true;
action = "<cmd>Neotree toggle<CR>";
};
};
};
theme = { theme = {
enable = true; enable = true;
name = "catppuccin"; name = "catppuccin";
style = "frappe"; style = "frappe";
}; };
maps = { visuals = {
normal = { enable = true;
"<leader>t" = { nvimWebDevicons.enable = true;
action = "<CMD>Neotree toggle<CR>";
silent = true;
};
}; };
ui = {
noice.enable = true;
}; };
statusline.lualine = { statusline.lualine = {
enable = true; enable = true;
theme = "catppuccin"; theme = "catppuccin";
}; };
git.enable = true;
lsp = { lsp = {
enable = true; enable = true;
lspSignature.enable = true; lspSignature.enable = true;
@ -110,14 +123,7 @@ in
}; };
binds.whichKey.enable = true; binds.whichKey.enable = true;
visuals.nvimWebDevicons.enable = true; filetree.neo-tree.enable = true;
filetree.neo-tree = {
enable = true;
setupOpts = {
git_status_async = true;
};
};
telescope.enable = true; telescope.enable = true;
}; };