From 27607212f1eb52c280eb3d837cac28d1417e003c Mon Sep 17 00:00:00 2001 From: ChUrl Date: Wed, 10 Aug 2022 21:55:00 +0200 Subject: [PATCH] add neovim module --- modules/kitty.nix | 60 +++++++++++++++++++++++++++++++++ modules/neovim.nix | 84 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 modules/kitty.nix create mode 100644 modules/neovim.nix diff --git a/modules/kitty.nix b/modules/kitty.nix new file mode 100644 index 00000000..67a1da5e --- /dev/null +++ b/modules/kitty.nix @@ -0,0 +1,60 @@ +{ config, nixosConfig, lib, mylib, pkgs, ... }: + +with lib; +with mylib.modules; + +let + cfg = config.modules.kitty; + cfgnv = config.modules.neovim; +in { + + options.modules.kitty = { + enable = mkEnableOpt "Kitty"; + }; + + config = mkIf cfg.enable { + # TODO: Copy config from Arch dots, also move the entire config folder (to allow ephemereal configs) + # TODO: Light/Dark theme option + programs.kitty = { + enable = true; + font = { + package = pkgs.victor-mono; + name = "Victor Mono SemiBold"; + size = 12; + }; + settings = { + editor = (if cfgnv.enable then "nvim" else "nano"); + scrollback_lines = 10000; + window_padding_width = 10; + # hide_window_decorations = "yes"; + + # Light Theme + # background = "#f7f7f7"; + # foreground = "#494542"; + # selection_background = "#a4a1a1"; + # selection_foreground = "#f7f7f7"; + # cursor = "#494542"; + # color0 = "#090200"; + # color1 = "#da2c20"; + # color2 = "#00a152"; + # color3 = "#ffcc00"; + # color4 = "#00a0e4"; + # color5 = "#a06994"; + # color6 = "#0077d9"; + # color7 = "#a4a1a1"; + # color8 = "#5b5754"; + # color9 = "#e8bacf"; + # color10 = "#3a3332"; + # color11 = "#494542"; + # color12 = "#7f7c7b"; + # color13 = "#d6d4d3"; + # color14 = "#ccab53"; + # color15 = "#d2b3ff"; + }; + keybindings = { + "kitty_mod+j" = "next_window"; + "kitty_mod+k" = "previous_window"; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/neovim.nix b/modules/neovim.nix new file mode 100644 index 00000000..6171276f --- /dev/null +++ b/modules/neovim.nix @@ -0,0 +1,84 @@ +{ config, nixosConfig, lib, mylib, pkgs, ... }: + +with lib; +with mylib.modules; + +let + cfg = config.modules.neovim; +in { + + options.modules.neovim = { + enable = mkEnableOpt "NeoVim"; + alias = mkBoolOpt "Link nvim to vim/vi"; + }; + + config = mkIf cfg.enable { + + programs.neovim = { + enable = true; + extraConfig = '' + set incsearch + set hlsearch + set ignorecase + set autoindent + set expandtab + set smartindent + set smarttab + set shiftwidth=4 + set softtabstop=4 + set backspace=indent,eol,start + set ruler + set number + set laststatus=2 + set noshowmode + set undofile + set undodir=~/.vim/undo + set hidden + set printfont=Victor\ Mono\ SemiBold:h10 + set guifont=Victor\ Mono\ SemiBold:h12 + let printencoding='utf-8' + set encoding=utf-8 + ''; + plugins = with pkgs.vimPlugins; [ + # vim-nix + surround-nvim + # lightline-vim + { + plugin = lualine-nvim; + config = '' + lua << EOF + require('lualine').setup {} + EOF + ''; + } + # vim-gitgutter + # YouCompleteMe + { + + plugin = nvim-autopairs; + config = '' + lua << EOF + require('nvim-autopairs').setup {} + EOF + ''; + } + { + plugin = (nvim-treesitter.withPlugins + (plugins: pkgs.tree-sitter.allGrammars)); + config = '' + lua << EOF + require('nvim-treesitter.configs').setup { + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + } + EOF + ''; + } + ]; + viAlias = cfg.alias; + vimAlias = cfg.alias; + }; + }; +}