diff --git a/modules/home/home/default.nix b/modules/home/home/default.nix index 566466d..626ffe4 100644 --- a/modules/home/home/default.nix +++ b/modules/home/home/default.nix @@ -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 = { diff --git a/modules/home/programs/neovim/default.nix b/modules/home/programs/neovim/default.nix new file mode 100644 index 0000000..a6bfa7d --- /dev/null +++ b/modules/home/programs/neovim/default.nix @@ -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}} + ''; + }; + }) + ]); +} diff --git a/modules/nixos/apps/neovim/default.nix b/modules/nixos/apps/neovim/default.nix deleted file mode 100644 index 0062e60..0000000 --- a/modules/nixos/apps/neovim/default.nix +++ /dev/null @@ -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]; - }; -} diff --git a/modules/nixos/suites/development/default.nix b/modules/nixos/suites/development/default.nix index ed347af..9ac938a 100644 --- a/modules/nixos/suites/development/default.nix +++ b/modules/nixos/suites/development/default.nix @@ -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 ]; }; }