moved nixvim into own home-manager module.
moved pass store location.
This commit is contained in:
parent
bbc6beb3da
commit
2253c6c34a
28 changed files with 24 additions and 11 deletions
28
modules/home-manager/nvim/treesitter/arial.nix
Normal file
28
modules/home-manager/nvim/treesitter/arial.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
config =
|
||||
lib.mkIf config.host.nvim.enable-treesitter
|
||||
{
|
||||
programs.nixvim = {
|
||||
keymaps = [
|
||||
{
|
||||
action = ":AerialToggle!<CR>";
|
||||
key = "<leader>o";
|
||||
mode = "n";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "toggle outline";
|
||||
};
|
||||
}
|
||||
];
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
aerial-nvim
|
||||
];
|
||||
extraConfigLua = ''require("aerial").setup({})'';
|
||||
};
|
||||
};
|
||||
}
|
40
modules/home-manager/nvim/treesitter/default.nix
Normal file
40
modules/home-manager/nvim/treesitter/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
host.nvim.enable-treesitter = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
enable nvim treesitter
|
||||
'';
|
||||
};
|
||||
};
|
||||
config =
|
||||
lib.mkIf config.host.nvim.enable-treesitter
|
||||
{
|
||||
host.nvim.enable-completions = true;
|
||||
programs.nixvim = {
|
||||
plugins.treesitter = {
|
||||
enable = true;
|
||||
folding = true;
|
||||
indent = true;
|
||||
nixvimInjections = true;
|
||||
};
|
||||
plugins.treesitter-context.enable = true;
|
||||
plugins.indent-blankline.enable = true;
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
treesj
|
||||
];
|
||||
extraConfigLua = ''require("treesj").setup({})'';
|
||||
};
|
||||
};
|
||||
imports = [
|
||||
./rainbow-delimiters.nix
|
||||
./arial.nix
|
||||
./tree-sitter-nu.nix
|
||||
];
|
||||
}
|
25
modules/home-manager/nvim/treesitter/rainbow-delimiters.nix
Normal file
25
modules/home-manager/nvim/treesitter/rainbow-delimiters.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
config =
|
||||
lib.mkIf config.host.nvim.enable-treesitter
|
||||
{
|
||||
programs.nixvim = {
|
||||
plugins.rainbow-delimiters = {
|
||||
enable = true;
|
||||
highlight = [
|
||||
"RainbowDelimiterYellow"
|
||||
"RainbowDelimiterBlue"
|
||||
"RainbowDelimiterOrange"
|
||||
"RainbowDelimiterGreen"
|
||||
"RainbowDelimiterViolet"
|
||||
"RainbowDelimiterCyan"
|
||||
# "RainbowDelimiterRed"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
53
modules/home-manager/nvim/treesitter/tree-sitter-nu.nix
Normal file
53
modules/home-manager/nvim/treesitter/tree-sitter-nu.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
config =
|
||||
lib.mkIf config.host.nvim.enable-treesitter
|
||||
{
|
||||
programs.nixvim = let
|
||||
nu-grammar = pkgs.tree-sitter.buildGrammar {
|
||||
language = "nu";
|
||||
version = "0.0.0+rev=358c4f5";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "nushell";
|
||||
repo = "tree-sitter-nu";
|
||||
rev = "c5b7816043992b1cdc1462a889bc74dc08576fa6";
|
||||
hash = "sha256-P+ixE359fAW7R5UJLwvMsmju7UFmJw5SN+kbMEw7Kz0=";
|
||||
};
|
||||
};
|
||||
in {
|
||||
# Set filetype to "nu" for files named "*.nu"
|
||||
filetype.extension.nu = "nu";
|
||||
|
||||
# Add our nu parser to treesitter and associate it with nu filetype.
|
||||
extraConfigLua = ''
|
||||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
parser_config.nu = {
|
||||
filetype = "nu",
|
||||
}
|
||||
'';
|
||||
|
||||
# Add the nu injections
|
||||
extraFiles = {
|
||||
"/queries/nu/highlights.scm" = builtins.readFile "${nu-grammar}/queries/nu/highlights.scm";
|
||||
"/queries/nu/injections.scm" = builtins.readFile "${nu-grammar}/queries/nu/injections.scm";
|
||||
"/queries/nu/indents.scm" = builtins.readFile "${nu-grammar}/queries/nu/indents.scm";
|
||||
};
|
||||
|
||||
plugins = {
|
||||
treesitter = {
|
||||
# Register the nu parser for files with "nu" filetype
|
||||
languageRegister.nu = "nu";
|
||||
grammarPackages =
|
||||
[
|
||||
nu-grammar
|
||||
]
|
||||
++ pkgs.vimPlugins.nvim-treesitter.allGrammars;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue