diff --git a/flake.lock b/flake.lock index 6c98a00..594c504 100644 --- a/flake.lock +++ b/flake.lock @@ -22,6 +22,23 @@ "type": "github" } }, + "cmp-vimtex": { + "flake": false, + "locked": { + "lastModified": 1708936870, + "narHash": "sha256-07FqXsRe0RP5f3b6osrsi5gai+bZi9ybm5JL/nnBH+4=", + "owner": "micangl", + "repo": "cmp-vimtex", + "rev": "613fbfc54d9488252b0b0289d6d1d60242513558", + "type": "github" + }, + "original": { + "owner": "micangl", + "ref": "master", + "repo": "cmp-vimtex", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -132,6 +149,7 @@ "root": { "inputs": { "NixOS-WSL": "NixOS-WSL", + "cmp-vimtex": "cmp-vimtex", "homeManager": "homeManager", "homeManager-23-11": "homeManager-23-11", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index a591965..9a1e84e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,28 +1,37 @@ { + description = "Configuration v1"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - nixpkgs-23-11.url = "github:NixOS/nixpkgs/nixos-23.11"; - homeManager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - homeManager-23-11 = { - url = "github:nix-community/home-manager/release-23.11"; - inputs.nixpkgs.follows = "nixpkgs-23-11"; - }; - - NixOS-WSL = { - url = "github:nix-community/NixOS-WSL"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + nixpkgs-23-11.url = "github:NixOS/nixpkgs/nixos-23.11"; + homeManager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { self, nixpkgs, homeManager, NixOS-WSL, nixpkgs-23-11, homeManager-23-11, ...}@inputs: { + homeManager-23-11 = { + url = "github:nix-community/home-manager/release-23.11"; + inputs.nixpkgs.follows = "nixpkgs-23-11"; + }; + NixOS-WSL = { + url = "github:nix-community/NixOS-WSL"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + cmp-vimtex = { + url = "github:micangl/cmp-vimtex/master"; + flake = false; + }; + }; + + outputs = { self, nixpkgs, homeManager, NixOS-WSL, nixpkgs-23-11, homeManager-23-11, cmp-vimtex, ...}@inputs: + let + customPackageOverlay = import ./overlays/cmp-vimtex.nix { inherit cmp-vimtex; }; + in + { nixosConfigurations = ( import ./hosts/hosts.nix { inherit nixpkgs; @@ -30,8 +39,10 @@ inherit inputs; inherit (nixpkgs) lib; inherit NixOS-WSL; - inherit nixpkgs-23-11; - inherit homeManager-23-11; + inherit nixpkgs-23-11; + inherit homeManager-23-11; + inherit cmp-vimtex; + inherit customPackageOverlay; } ); diff --git a/home/deepak/home.nix b/home/deepak/home.nix index d1e007e..9dd9d4d 100644 --- a/home/deepak/home.nix +++ b/home/deepak/home.nix @@ -82,10 +82,17 @@ vim-fugitive friendly-snippets luasnip + pkgs.customVimPlugins.cmp-vimtex ]; extraConfig = '' inoremap jj inoremap kk + + set tabstop=4 + set noexpandtab + set list + set listchars=eol:¬,tab:▸\,trail:· + lua << EOF local lsp_zero = require('lsp-zero') @@ -104,6 +111,7 @@ {name = 'nvim_lsp'}, {name = 'buffer'}, {name = 'luasnip'}, + {name = 'vimtex'}, }, formatting = cmp_format, mapping = cmp.mapping.preset.insert({ diff --git a/hosts/hosts.nix b/hosts/hosts.nix index 99e7414..642efe2 100644 --- a/hosts/hosts.nix +++ b/hosts/hosts.nix @@ -1,7 +1,10 @@ -{ lib, inputs, nixpkgs, nixpkgs-23-11, homeManager, homeManager-23-11, NixOS-WSL, ... }: +{ lib, inputs, nixpkgs-23-11, homeManager, homeManager-23-11, NixOS-WSL, customPackageOverlay, ... }: { "maxos" = lib.nixosSystem { system = "x86_64-linux"; + specialArgs = { + inherit customPackageOverlay; + }; modules = [ ./maxos/configuration.nix homeManager.nixosModules.home-manager { @@ -19,6 +22,9 @@ "nixosWSL" = nixpkgs-23-11.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = { + inherit customPackageOverlay; + }; modules = [ ./nixosWSL/configuration.nix homeManager-23-11.nixosModules.home-manager { diff --git a/hosts/maxos/configuration.nix b/hosts/maxos/configuration.nix index 299351e..ad7a7aa 100644 --- a/hosts/maxos/configuration.nix +++ b/hosts/maxos/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ pkgs, ... }: +{ pkgs, customPackageOverlay, ... }: let custom-fonts = import ../../fonts { inherit pkgs; }; @@ -109,6 +109,9 @@ in programs.zsh.enable = true; nixpkgs.config.allowUnfree = true; + nixpkgs.overlays = [ + customPackageOverlay.overlay + ]; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. diff --git a/hosts/nixosWSL/configuration.nix b/hosts/nixosWSL/configuration.nix index d5e32e5..55dca1c 100644 --- a/hosts/nixosWSL/configuration.nix +++ b/hosts/nixosWSL/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, modulesPath, ... }: +{ pkgs, customPackageOverlay, modulesPath, ... }: let custom-fonts = import ../../fonts { inherit pkgs; }; @@ -34,6 +34,10 @@ in experimental-features = nix-command flakes ''; + nixpkgs.overlays = [ + customPackageOverlay.overlay + ]; + system.stateVersion = "22.05"; # Define a user account. Don't forget to set a password with ‘passwd’. diff --git a/overlays/cmp-vimtex.nix b/overlays/cmp-vimtex.nix new file mode 100644 index 0000000..d0f9f7b --- /dev/null +++ b/overlays/cmp-vimtex.nix @@ -0,0 +1,15 @@ +{ cmp-vimtex }: +{ + overlay = final: prev: + let + cmpVimtexPlugin = prev.vimUtils.buildVimPlugin { + src = cmp-vimtex; + name = "cmp-vimtex"; + }; + in + { + customVimPlugins = [ + cmpVimtexPlugin + ]; + }; +}