mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 23:22:57 +00:00
partial setup of neovim for home config
This commit is contained in:
parent
397b08fab4
commit
dfacb580ae
49
flake.nix
49
flake.nix
@ -108,6 +108,13 @@
|
|||||||
dotfilesRepo = "git@github.com:nmasur/dotfiles";
|
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.
|
# System types to support.
|
||||||
supportedSystems =
|
supportedSystems =
|
||||||
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
||||||
@ -118,13 +125,13 @@
|
|||||||
in rec {
|
in rec {
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
desktop = import ./hosts/desktop { inherit inputs globals; };
|
desktop = import ./hosts/desktop { inherit inputs globals overlays; };
|
||||||
wsl = import ./hosts/wsl { inherit inputs globals; };
|
wsl = import ./hosts/wsl { inherit inputs globals overlays; };
|
||||||
oracle = import ./hosts/oracle { inherit inputs globals; };
|
oracle = import ./hosts/oracle { inherit inputs globals overlays; };
|
||||||
};
|
};
|
||||||
|
|
||||||
darwinConfigurations = {
|
darwinConfigurations = {
|
||||||
macbook = import ./hosts/macbook { inherit inputs globals; };
|
macbook = import ./hosts/macbook { inherit inputs globals overlays; };
|
||||||
};
|
};
|
||||||
|
|
||||||
# For quickly applying local settings with:
|
# For quickly applying local settings with:
|
||||||
@ -140,42 +147,26 @@
|
|||||||
packages = forAllSystems (system: {
|
packages = forAllSystems (system: {
|
||||||
|
|
||||||
aws = {
|
aws = {
|
||||||
"${system}" = import ./hosts/aws { inherit inputs globals system; };
|
"${system}" =
|
||||||
|
import ./hosts/aws { inherit inputs globals system overlays; };
|
||||||
};
|
};
|
||||||
|
|
||||||
neovim = let
|
neovim = let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
pkgs = import nixpkgs {
|
in import ./modules/neovim/package {
|
||||||
inherit system;
|
inherit pkgs;
|
||||||
overlays = [
|
colors = import ./modules/colorscheme/gruvbox/neovim-gruvbox.nix {
|
||||||
(import ./modules/neovim/plugins-overlay.nix inputs)
|
inherit pkgs;
|
||||||
inputs.nix2vim.overlay
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
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:
|
apps = forAllSystems (system:
|
||||||
let pkgs = import nixpkgs { inherit system; };
|
let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
in import ./apps { inherit pkgs; });
|
in import ./apps { inherit pkgs; });
|
||||||
|
|
||||||
devShells = forAllSystems (system:
|
devShells = forAllSystems (system:
|
||||||
let pkgs = import nixpkgs { inherit system; };
|
let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
in {
|
in {
|
||||||
|
|
||||||
# Used to run commands and edit files in this repo
|
# Used to run commands and edit files in this repo
|
||||||
|
@ -22,7 +22,7 @@ darwin.lib.darwinSystem {
|
|||||||
};
|
};
|
||||||
mailUser = globals.user;
|
mailUser = globals.user;
|
||||||
networking.hostName = "noah-masur-mac";
|
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
|
# Set registry to flake packages, used for nix X commands
|
||||||
nix.registry.nixpkgs.flake = nixpkgs;
|
nix.registry.nixpkgs.flake = nixpkgs;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
base0D = "#83a598"; # blue
|
base0D = "#83a598"; # blue
|
||||||
base0E = "#d3869b"; # purple
|
base0E = "#d3869b"; # purple
|
||||||
base0F = "#d65d0e"; # brown
|
base0F = "#d65d0e"; # brown
|
||||||
neovimConfig = ./neovim.lua;
|
neovimConfig = ./neovim-gruvbox.nix;
|
||||||
batTheme = "gruvbox-dark";
|
batTheme = "gruvbox-dark";
|
||||||
};
|
};
|
||||||
light = {
|
light = {
|
||||||
@ -39,7 +39,7 @@
|
|||||||
base0D = "#076678"; # blue
|
base0D = "#076678"; # blue
|
||||||
base0E = "#8f3f71"; # purple
|
base0E = "#8f3f71"; # purple
|
||||||
base0F = "#d65d0e"; # brown
|
base0F = "#d65d0e"; # brown
|
||||||
neovimConfig = ./neovim.lua;
|
neovimConfig = ./neovim-gruvbox.nix;
|
||||||
batTheme = "gruvbox-light";
|
batTheme = "gruvbox-light";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -2,29 +2,13 @@
|
|||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = [
|
||||||
neovim
|
(import ./package {
|
||||||
gcc # for tree-sitter
|
inherit pkgs;
|
||||||
tree-sitter # for tree-sitter-gitignore parser
|
colors = import config.theme.colors.neovimConfig { inherit pkgs; };
|
||||||
nodejs # for tree-sitter-gitignore parser
|
})
|
||||||
shfmt # used everywhere
|
|
||||||
shellcheck # used everywhere
|
|
||||||
];
|
];
|
||||||
|
|
||||||
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";
|
programs.git.extraConfig.core.editor = "nvim";
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "nvim";
|
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
|
# # Used for icons in Vim
|
||||||
fonts.fonts = with pkgs; [ nerdfonts ];
|
# fonts.fonts = with pkgs; [ nerdfonts ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
46
modules/neovim/package/default.nix
Normal file
46
modules/neovim/package/default.nix
Normal 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
|
||||||
|
];
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user