modules/nixvim: add nixvim to config

This commit is contained in:
xinyangli 2024-08-20 21:04:46 +08:00
parent db2e696389
commit 47ee5ef21f
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
6 changed files with 407 additions and 94 deletions

View file

@ -9,4 +9,4 @@
./vscode.nix
./zellij.nix
];
}
}

View file

@ -1,43 +1,22 @@
{ config, pkgs, lib, ... }:
with lib;
{ config, pkgs, lib, ... }:
let
inherit (lib) mkIf mkEnableOption getExe;
cfg = config.custom-hm.neovim;
tomlFormat = pkgs.formats.toml { };
neovideConfig = {
neovim-bin = getExe pkgs.nixvim;
fork = true;
};
in
{
options.custom-hm.neovim = {
enable = mkEnableOption "neovim configurations";
};
config = mkIf cfg.enable {
programs.neovim = {
enable = true;
vimAlias = true;
vimdiffAlias = true;
plugins = with pkgs.vimPlugins; [
catppuccin-nvim
];
extraConfig = ''
set nocompatible
syntax on
set number
set relativenumber
set shortmess+=I
set laststatus=2
set ignorecase
set smartcase
set list
set listchars=tab:·
set tabstop=4
set shiftwidth=4
set expandtab
set mouse+=a
colorscheme catppuccin-macchiato
'';
home.packages = with pkgs; [ nixvim neovide ];
programs.neovim.enable = false;
home.file.".config/neovide/config.toml" = {
source = tomlFormat.generate "neovide-config" neovideConfig;
};
};
}