Updated neovim config to be a home module

This commit is contained in:
alejandro-angulo 2024-08-22 16:54:29 -07:00
parent 14620e645f
commit 0799e51593
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
4 changed files with 43 additions and 26 deletions

View file

@ -40,8 +40,9 @@
fzf.enable = true;
gpg.enable = true;
kitty.enable = true;
zoxide.enable = true;
neovim.enable = true;
yazi.enable = true;
zoxide.enable = true;
};
tools = {

View file

@ -0,0 +1,39 @@
{
config,
lib,
pkgs,
namespace,
...
}: let
cfg = config.${namespace}.programs.neovim;
in {
options.${namespace}.programs.neovim = {
enable = lib.mkEnableOption "neovim";
lazygit.enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Enables lazygit integration.
This makes it so that editing a file from lazygit opens a buffer in
the current instance.
'';
};
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{home.packages = [pkgs.neovim];}
(lib.mkIf cfg.lazygit.enable {
programs.zsh.shellAliases = {
nvim = "${pkgs.neovim}/bin/nvim --listen /tmp/nvim-server.pipe";
};
programs.lazygit.settings.os = {
editCommand = "nvim";
editCommandTemplate = ''
{{editor}} --server /tmp/nvim-server.pipe --remote-tab {{filename}}
'';
};
})
]);
}

View file

@ -1,18 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.aa.apps.neovim;
in {
options.aa.apps.neovim = {
enable = mkEnableOption "neovim";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [neovim];
};
}

View file

@ -12,18 +12,13 @@ in {
};
config = mkIf cfg.enable {
aa = {
apps = {
neovim.enable = true;
};
};
environment.systemPackages = with pkgs; [
awscli2
direnv
git
minio-client
pre-commit
git
vim
];
};
}