Updated neovim config to be a home module
This commit is contained in:
parent
14620e645f
commit
0799e51593
|
@ -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 = {
|
||||
|
|
39
modules/home/programs/neovim/default.nix
Normal file
39
modules/home/programs/neovim/default.nix
Normal 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}}
|
||||
'';
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -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];
|
||||
};
|
||||
}
|
|
@ -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
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue