From 9078b65d49591c9e23836ee793aebd808664a424 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Tue, 24 Sep 2024 23:47:40 +0200 Subject: [PATCH] neovim: add a bunch of configuration --- flake.lock | 18 +++---- flake.nix | 89 +++++++++++++++----------------- home/common/programs/default.nix | 1 - hosts/vamos/default.nix | 11 ++-- modules/neovim.nix | 46 ++++++++++------- 5 files changed, 84 insertions(+), 81 deletions(-) diff --git a/flake.lock b/flake.lock index cf22d04..93976c7 100644 --- a/flake.lock +++ b/flake.lock @@ -683,11 +683,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1727149466, - "narHash": "sha256-xOZq7IhHrkLhjdhfcdaDY4Ru2o0C9jtuoEpUtGGFYJE=", + "lastModified": 1727186381, + "narHash": "sha256-T6vSJAvbYSBsaUkwh2adbIt7liE2xpcRhmlosMNZnDo=", "owner": "nix-community", "repo": "nixvim", - "rev": "901346e38b81c236305e29934dd02c1f64bd8621", + "rev": "8f991cc8bc417ddbd1d5c7732268255557c13f4a", "type": "github" }, "original": { @@ -848,11 +848,11 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1727148426, - "narHash": "sha256-R0mIsBwxtX6i54XvM02JXTAq5xmbmOvYyGWc5GiOIxI=", + "lastModified": 1727179231, + "narHash": "sha256-Jm9w3lBmX5D2IKhmpGUvb4XXEK8h3rqGv1LETphJEiY=", "owner": "notashelf", "repo": "nvf", - "rev": "316f25a0f62696b289ad4b944789beaae7fa9415", + "rev": "8e96f0aaa325b992d17a3e7c9613344680375791", "type": "github" }, "original": { @@ -1985,11 +1985,11 @@ "plugin-nvim-treesitter-context": { "flake": false, "locked": { - "lastModified": 1716388265, - "narHash": "sha256-EY5Si6t7LXcxOP3ubGAAMd3lgbeaCOCIybSKi1Ucx98=", + "lastModified": 1726947805, + "narHash": "sha256-5oN/vyhSqDqjLEzECj01A7A+Yq7U1H1HXLbzkC1Ljqw=", "owner": "nvim-treesitter", "repo": "nvim-treesitter-context", - "rev": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683", + "rev": "3d5390c49e3f8fe457b376df2a49aa39d75b7911", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 1bceba6..b9dff0f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,61 +1,58 @@ { description = "nezia's nixos configuration"; - outputs = - { - nixpkgs, - home-manager, - nixvim, - nvf, - sops-nix, - stylix, - ... - }@inputs: - let - username = "nezia"; - system = "x86_64-linux"; + outputs = { + nixpkgs, + home-manager, + nixvim, + sops-nix, + stylix, + ... + } @ inputs: let + username = "nezia"; + system = "x86_64-linux"; - commonModules = hostname: [ - ./modules - ./hosts/common - ./hosts/${hostname} + commonModules = hostname: [ + ./modules + ./hosts/common + ./hosts/${hostname} - sops-nix.nixosModules.sops - stylix.nixosModules.stylix - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.sharedModules = [ + sops-nix.nixosModules.sops + stylix.nixosModules.stylix + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + sharedModules = [ nixvim.homeManagerModules.nixvim ]; - home-manager.extraSpecialArgs = { + extraSpecialArgs = { inherit inputs system; }; - } - { - _module.args = { - inherit hostname username; - }; - } - ]; - - configureSystem = - hostname: homeConfig: - nixpkgs.lib.nixosSystem { - system = system; - modules = commonModules hostname ++ [ { home-manager.users."${username}" = import homeConfig; } ]; - specialArgs = { - inherit inputs; - }; }; - in - { - nixosConfigurations = { - vamos = configureSystem "vamos" ./home/laptop; - solaire = configureSystem "solaire" ./home/desktop; + } + { + _module.args = { + inherit hostname username; + }; + } + ]; + + configureSystem = hostname: homeConfig: + nixpkgs.lib.nixosSystem { + inherit system; + modules = commonModules hostname ++ [{home-manager.users."${username}" = import homeConfig;}]; + specialArgs = { + inherit inputs; + }; }; + in { + nixosConfigurations = { + vamos = configureSystem "vamos" ./home/laptop; + solaire = configureSystem "solaire" ./home/desktop; }; + }; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; diff --git a/home/common/programs/default.nix b/home/common/programs/default.nix index 53d1c5c..cad9067 100644 --- a/home/common/programs/default.nix +++ b/home/common/programs/default.nix @@ -2,7 +2,6 @@ _: { imports = [ ./git.nix ./gnupg.nix - # ./wezterm.nix ./browsers.nix ./miscellaneous.nix ]; diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index d68a1dc..72a9dda 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -1,6 +1,4 @@ -{ inputs, ... }: - -{ +{inputs, ...}: { imports = [ ./hardware-configuration.nix inputs.nixos-hardware.nixosModules.framework-13-7040-amd @@ -12,7 +10,7 @@ enable = true; keyboards = { default = { - ids = [ "*" ]; + ids = ["*"]; settings = { main = { capslock = "overload(control, esc)"; @@ -21,5 +19,8 @@ }; }; }; - modules.neovim.enable = true; + modules = { + neovim.enable = true; + wezterm.enable = true; + }; } diff --git a/modules/neovim.nix b/modules/neovim.nix index 57c0195..e277a5f 100644 --- a/modules/neovim.nix +++ b/modules/neovim.nix @@ -5,11 +5,9 @@ pkgs, username, ... -}: -let +}: let cfg = config.modules.neovim; -in -{ +in { options.modules.neovim.enable = lib.mkEnableOption "neovim"; config = lib.mkIf cfg.enable { @@ -18,7 +16,7 @@ in }; home-manager.users.${username} = { - imports = [ inputs.nvf.homeManagerModules.default ]; + imports = [inputs.nvf.homeManagerModules.default]; programs.nvf = { enable = true; @@ -39,25 +37,40 @@ in '' ]; + maps = { + normal = { + "m" = { + silent = true; + action = "make"; + }; # Same as nnoremap m make + "t" = { + silent = true; + action = "Neotree toggle"; + }; + }; + }; theme = { enable = true; name = "catppuccin"; style = "frappe"; }; - maps = { - normal = { - "t" = { - action = "Neotree toggle"; - silent = true; - }; - }; + visuals = { + enable = true; + nvimWebDevicons.enable = true; }; + + ui = { + noice.enable = true; + }; + statusline.lualine = { enable = true; theme = "catppuccin"; }; + git.enable = true; + lsp = { enable = true; lspSignature.enable = true; @@ -110,14 +123,7 @@ in }; binds.whichKey.enable = true; - visuals.nvimWebDevicons.enable = true; - - filetree.neo-tree = { - enable = true; - setupOpts = { - git_status_async = true; - }; - }; + filetree.neo-tree.enable = true; telescope.enable = true; };