neovim: move from hosts/ to pkgs/

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2024-05-28 05:14:11 +05:30
parent c1c4714fa2
commit f748daba0f
11 changed files with 75 additions and 58 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

View File

@@ -55,11 +55,12 @@
]; ];
perSystem = { system, pkgs, ... }: perSystem = { system, pkgs, ... }:
{ rec {
formatter = pkgs.nixpkgs-fmt; formatter = pkgs.nixpkgs-fmt;
devShells.default = with pkgs; mkShell { devShells.default = with pkgs; mkShell {
packages = [ packages = [
nixd nixd
formatter
]; ];
}; };
}; };

View File

@@ -3,7 +3,7 @@ let
inherit (inputs) nixpkgs; inherit (inputs) nixpkgs;
commonModules = [ commonModules = [
./nvim ./nvim.nix
globalArgs globalArgs
]; ];
desktopModules = [ desktopModules = [

View File

@@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, self, ... }:
{ {
nixpkgs = { nixpkgs = {
config = { config = {
@@ -6,6 +6,9 @@
allowBroken = true; allowBroken = true;
allowInsecure = true; allowInsecure = true;
}; };
overlays = [
self.overlays.default
];
}; };
nix = { nix = {

7
hosts/nvim.nix Normal file
View File

@@ -0,0 +1,7 @@
{ inputs, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
(nattovim.override { nvimPackage = inputs.nvim-overlay.packages.${pkgs.system}.neovim; })
];
}

View File

@@ -1,49 +0,0 @@
{ inputs, config, pkgs, ... }:
{
environment.sessionVariables = {
EDITOR = "nvim";
};
programs.neovim = {
enable = true;
package = inputs.nvim-overlay.packages.${pkgs.system}.neovim;
defaultEditor = false;
configure = {
customRC = ''
lua << EOF
${builtins.readFile ./init.lua}
EOF
'';
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
nvim-colorizer-lua
bracey-vim
auto-pairs
vim-floaterm
vim-closetag
nerdcommenter
nvim-cmp
luasnip
friendly-snippets
cmp_luasnip
cmp-nvim-lsp
cmp-path
cmp-calc
cmp-emoji
# cmp-look
cmp-buffer
nvim-lspconfig
barbar-nvim
presence-nvim
nvim-web-devicons
nvim-tree-lua
nvim-treesitter
vim-latex-live-preview
lspkind-nvim
catppuccin-nvim
yuck-vim
];
};
};
};
}

View File

@@ -1,14 +1,8 @@
{ self, ... }: { { self, ... }: {
systems = [ "x86_64-linux" ];
flake = { flake = {
overlays = rec { overlays = rec {
packages = import ./packages.nix; packages = import ./packages.nix;
default = packages; default = packages;
}; };
}; };
perSystem = { pkgs, ... }: {
packages = self.overlays.default null pkgs;
};
} }

59
pkgs/nattovim/default.nix Normal file
View File

@@ -0,0 +1,59 @@
{ wrapNeovimUnstable, neovimUtils, neovim-unwrapped, nvimPackage ? neovim-unwrapped, vimPlugins, ... }:
let
nvimConfig = neovimUtils.makeNeovimConfig {
plugins = with vimPlugins; [
nvim-colorizer-lua
autoclose-nvim
toggleterm-nvim
luasnip
nvim-cmp
nvim-lspconfig
cmp-nvim-lsp
cmp-path
cmp-calc
cmp-emoji
cmp-buffer
barbar-nvim
nvim-web-devicons
presence-nvim
nvim-tree-lua
nvim-treesitter
lspkind-nvim
catppuccin-nvim
telescope-nvim
];
};
in
wrapNeovimUnstable nvimPackage (nvimConfig // {
luaRcContent = ''
${builtins.readFile ./init.lua}
'';
})
/* wrapNeovim nvimPackage {
configure = {
customRC = ''
${builtins.readFile ./init.lua}
'';
packages.myVimPackage = with vimPlugins; {
start = [
nvim-colorizer-lua
autoclose-nvim
toggleterm-nvim
nvim-cmp
nvim-lspconfig
cmp-nvim-lsp
cmp-path
cmp-calc
cmp-emoji
cmp-buffer
barbar-nvim
nvim-web-devicons
presence-nvim
nvim-tree-lua
nvim-treesitter
lspkind-nvim
catppuccin-nvim
];
};
};
}*/

View File

@@ -6,4 +6,5 @@ in
customscripts = call ./customscripts { }; customscripts = call ./customscripts { };
tlauncher = call ./tlauncher { }; tlauncher = call ./tlauncher { };
simp1e-cursors = call ./simp1e { }; simp1e-cursors = call ./simp1e { };
nattovim = call ./nattovim { };
} }