partial setup of neovim for home config

This commit is contained in:
Noah Masur 2022-11-29 19:14:14 -07:00
parent 397b08fab4
commit dfacb580ae
19 changed files with 76 additions and 62 deletions

View File

@ -108,6 +108,13 @@
dotfilesRepo = "git@github.com:nmasur/dotfiles";
};
# Common overlays to always use
overlays = [
inputs.nur.overlay
inputs.nix2vim.overlay
(import ./modules/neovim/plugins-overlay.nix inputs)
];
# System types to support.
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
@ -118,13 +125,13 @@
in rec {
nixosConfigurations = {
desktop = import ./hosts/desktop { inherit inputs globals; };
wsl = import ./hosts/wsl { inherit inputs globals; };
oracle = import ./hosts/oracle { inherit inputs globals; };
desktop = import ./hosts/desktop { inherit inputs globals overlays; };
wsl = import ./hosts/wsl { inherit inputs globals overlays; };
oracle = import ./hosts/oracle { inherit inputs globals overlays; };
};
darwinConfigurations = {
macbook = import ./hosts/macbook { inherit inputs globals; };
macbook = import ./hosts/macbook { inherit inputs globals overlays; };
};
# For quickly applying local settings with:
@ -140,42 +147,26 @@
packages = forAllSystems (system: {
aws = {
"${system}" = import ./hosts/aws { inherit inputs globals system; };
"${system}" =
import ./hosts/aws { inherit inputs globals system overlays; };
};
neovim = let
pkgs = import nixpkgs {
inherit system;
overlays = [
(import ./modules/neovim/plugins-overlay.nix inputs)
inputs.nix2vim.overlay
];
neovim = let pkgs = import nixpkgs { inherit system overlays; };
in import ./modules/neovim/package {
inherit pkgs;
colors = import ./modules/colorscheme/gruvbox/neovim-gruvbox.nix {
inherit pkgs;
};
in pkgs.neovimBuilder {
package = pkgs.neovim-unwrapped;
imports = [
./modules/neovim/plugins/gitsigns.nix
./modules/neovim/plugins/misc.nix
./modules/neovim/plugins/syntax.nix
./modules/neovim/plugins/statusline.nix
./modules/neovim/plugins/bufferline.nix
./modules/neovim/plugins/telescope.nix
./modules/neovim/plugins/lsp.nix
./modules/neovim/plugins/completion.nix
./modules/neovim/plugins/toggleterm.nix
./modules/neovim/plugins/tree.nix
./modules/colorscheme/gruvbox/neovim-gruvbox.nix
];
};
});
apps = forAllSystems (system:
let pkgs = import nixpkgs { inherit system; };
let pkgs = import nixpkgs { inherit system overlays; };
in import ./apps { inherit pkgs; });
devShells = forAllSystems (system:
let pkgs = import nixpkgs { inherit system; };
let pkgs = import nixpkgs { inherit system overlays; };
in {
# Used to run commands and edit files in this repo

View File

@ -22,7 +22,7 @@ darwin.lib.darwinSystem {
};
mailUser = globals.user;
networking.hostName = "noah-masur-mac";
nixpkgs.overlays = [ nur.overlay firefox-darwin.overlay ];
nixpkgs.overlays = [ firefox-darwin.overlay ];
# Set registry to flake packages, used for nix X commands
nix.registry.nixpkgs.flake = nixpkgs;
}

View File

@ -19,7 +19,7 @@
base0D = "#83a598"; # blue
base0E = "#d3869b"; # purple
base0F = "#d65d0e"; # brown
neovimConfig = ./neovim.lua;
neovimConfig = ./neovim-gruvbox.nix;
batTheme = "gruvbox-dark";
};
light = {
@ -39,7 +39,7 @@
base0D = "#076678"; # blue
base0E = "#8f3f71"; # purple
base0F = "#d65d0e"; # brown
neovimConfig = ./neovim.lua;
neovimConfig = ./neovim-gruvbox.nix;
batTheme = "gruvbox-light";
};
}

View File

@ -2,29 +2,13 @@
home-manager.users.${config.user} = {
home.packages = with pkgs; [
neovim
gcc # for tree-sitter
tree-sitter # for tree-sitter-gitignore parser
nodejs # for tree-sitter-gitignore parser
shfmt # used everywhere
shellcheck # used everywhere
home.packages = [
(import ./package {
inherit pkgs;
colors = import config.theme.colors.neovimConfig { inherit pkgs; };
})
];
xdg.configFile = {
"nvim/init.lua".source = ./init.lua;
"nvim/lua" = {
source = ./lua;
recursive = true; # Allows adding more files
};
"nvim/lua/packer/colors.lua".source = config.theme.colors.neovimConfig;
"nvim/lua/background.lua".text = ''
vim.o.background = "${
if config.theme.dark == true then "dark" else "light"
}"
'';
};
programs.git.extraConfig.core.editor = "nvim";
home.sessionVariables = {
EDITOR = "nvim";
@ -39,16 +23,9 @@
};
};
# Always run packer.nvim sync
home.activation.nvimPackerSync =
config.home-manager.users.${config.user}.lib.dag.entryAfter
[ "writeBoundary" ] ''
$DRY_RUN_CMD ${pkgs.neovim}/bin/nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
'';
};
# Used for icons in Vim
fonts.fonts = with pkgs; [ nerdfonts ];
# # Used for icons in Vim
# fonts.fonts = with pkgs; [ nerdfonts ];
}

View File

@ -0,0 +1,46 @@
# { inputs, globals, extraConfig ? [ ], ... }:
#
# let
#
# pkgs = import inputs.nixpkgs {
# system = inputs.system;
# overlays = [
# (import ./modules/neovim/plugins-overlay.nix inputs)
# inputs.nix2vim.overlay
# ];
# };
#
# in pkgs.neovimBuilder {
# package = pkgs.neovim-unwrapped;
# imports = [
# ./modules/neovim/plugins/bufferline.nix
# ./modules/neovim/plugins/completion.nix
# ./modules/neovim/plugins/gitsigns.nix
# ./modules/neovim/plugins/lsp.nix
# ./modules/neovim/plugins/misc.nix
# ./modules/neovim/plugins/statusline.nix
# ./modules/neovim/plugins/syntax.nix
# ./modules/neovim/plugins/telescope.nix
# ./modules/neovim/plugins/toggleterm.nix
# ./modules/neovim/plugins/tree.nix
# ] ++ extraConfig;
# }
{ pkgs, colors ? { }, ... }:
pkgs.neovimBuilder {
package = pkgs.neovim-unwrapped;
imports = [
../config/bufferline.nix
../config/completion.nix
../config/gitsigns.nix
../config/lsp.nix
../config/misc.nix
../config/statusline.nix
../config/syntax.nix
../config/telescope.nix
../config/toggleterm.nix
../config/tree.nix
colors
];
}