137 lines
3.7 KiB
Nix
137 lines
3.7 KiB
Nix
inputs@{ machine, ... }:
|
|
{
|
|
imports = machine.program {
|
|
name = "nvim";
|
|
inherit inputs;
|
|
requirements = [ "cli" ];
|
|
home-config =
|
|
{
|
|
pkgs,
|
|
pkgs-unstable,
|
|
flakes,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
nvim_mime_types = (import ../xdg/mimemap.nix).text;
|
|
desktop-entry-name = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanvim";
|
|
desktop-entry = pkgs.makeDesktopItem {
|
|
name = desktop-entry-name;
|
|
desktopName = "neovim";
|
|
exec = "${./editor-hax.py} %F";
|
|
tryExec = "${./editor-hax.py}";
|
|
terminal = false;
|
|
type = "Application";
|
|
categories = [
|
|
"Utility"
|
|
"TextEditor"
|
|
];
|
|
icon = "terminal";
|
|
mimeTypes = nvim_mime_types;
|
|
};
|
|
in
|
|
{
|
|
home = {
|
|
sessionVariables = {
|
|
EDITOR = "nvim";
|
|
};
|
|
|
|
packages = with pkgs-unstable; [
|
|
tree-sitter
|
|
(pkgs.stdenv.mkDerivation {
|
|
name = "editor-hax";
|
|
src = ./.;
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp ./editor-hax.py $out/bin/editor-hax
|
|
'';
|
|
})
|
|
];
|
|
};
|
|
|
|
home.file.".local/share/applications/${desktop-entry-name}.desktop" = {
|
|
source = "${desktop-entry}/share/applications/${desktop-entry-name}.desktop";
|
|
};
|
|
|
|
xdg.mimeApps.associations.added = lib.mergeAttrsList (
|
|
map (mime: {
|
|
${mime} = [ "${desktop-entry-name}.desktop" ];
|
|
}) nvim_mime_types
|
|
);
|
|
|
|
imports = [
|
|
flakes.nixvim.homeModules.nixvim
|
|
./options.nix
|
|
./plugins.nix
|
|
./keys.nix
|
|
];
|
|
|
|
programs.nixvim = {
|
|
enable = true;
|
|
globals.mapleader = " ";
|
|
globals.maplocalleader = " ";
|
|
|
|
viAlias = true;
|
|
vimAlias = true;
|
|
|
|
# Highlight and remove extra white spaces
|
|
# same color as cursorline as per
|
|
# https://github.com/joshdick/onedark.vim/blob/390b893d361c356ac1b00778d849815f2aa44ae4/autoload/onedark.vim
|
|
highlight.ExtraWhitespace.bg = "#2C323C";
|
|
match.ExtraWhitespace = "\\s\\+$";
|
|
|
|
clipboard.providers.wl-copy.enable = true;
|
|
|
|
performance = {
|
|
byteCompileLua.enable = true;
|
|
combinePlugins = {
|
|
enable = false;
|
|
|
|
standalonePlugins = [
|
|
# clashes with lualine
|
|
];
|
|
};
|
|
};
|
|
|
|
extraLuaPackages = ps: [ ps.magick ];
|
|
extraPackages = [ pkgs.imagemagick ];
|
|
|
|
# package = (import inputs.unstable { inherit (pkgs) system; }).neovim-unwrapped;
|
|
# package = pkgs.neovim-unwrapped;
|
|
package = with pkgs-unstable; neovim-unwrapped;
|
|
|
|
colorschemes.onedark = {
|
|
enable = true;
|
|
settings = {
|
|
style = "deep";
|
|
|
|
highlights = {
|
|
# bright green doccomments
|
|
"@lsp.type.comment".fg = "#77B767";
|
|
"@comment.documentation.rust".fg = "#77B767";
|
|
"@comment.documentation".fg = "#77B767";
|
|
"@comment".fg = "#426639";
|
|
# "Visual".bg = "#2a2e36";
|
|
# "Cursorline".bg = "#2a2e36";
|
|
};
|
|
|
|
};
|
|
};
|
|
|
|
extraConfigLuaPre = ''
|
|
require("neoconf").setup({})
|
|
'';
|
|
extraConfigLua = ''
|
|
require("render-markdown").setup {
|
|
latex_converter = '${pkgs.python312Packages.pylatexenc}/bin/latex2text',
|
|
}
|
|
''
|
|
|
|
+ (builtins.readFile ./config.lua);
|
|
extraConfigLuaPost = ''
|
|
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|