neovim: add first nixeovim config

This commit is contained in:
Dmitriy Pleshevskiy 2024-05-10 02:39:22 +03:00
parent a6684815a3
commit 4d8d514eaa
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
5 changed files with 164 additions and 592 deletions

View file

@ -45,70 +45,6 @@
"type": "github" "type": "github"
} }
}, },
"cmp-luasnip": {
"flake": false,
"locked": {
"lastModified": 1666943769,
"narHash": "sha256-Z5SPy3j2oHFxJ7bK8DP8Q/oRyLEMlnWyIfDaQcNVIS0=",
"owner": "saadparwaiz1",
"repo": "cmp_luasnip",
"rev": "18095520391186d634a0045dacaa346291096566",
"type": "github"
},
"original": {
"owner": "saadparwaiz1",
"repo": "cmp_luasnip",
"type": "github"
}
},
"cmp-nvim-lsp": {
"flake": false,
"locked": {
"lastModified": 1687494203,
"narHash": "sha256-mU0soCz79erJXMMqD/FyrJZ0mu2n6fE0deymPzQlxts=",
"owner": "hrsh7th",
"repo": "cmp-nvim-lsp",
"rev": "44b16d11215dce86f253ce0c30949813c0a90765",
"type": "github"
},
"original": {
"owner": "hrsh7th",
"repo": "cmp-nvim-lsp",
"type": "github"
}
},
"cmp-tabby": {
"flake": false,
"locked": {
"lastModified": 1681450408,
"narHash": "sha256-0swK9LV91SeZO0SQl8zVs7GmQNMYwQm7XyQE0iPbc/w=",
"owner": "nzlov",
"repo": "cmp-tabby",
"rev": "c0cb81024ee1500a722b3c35f64dd282c11bc7ba",
"type": "github"
},
"original": {
"owner": "nzlov",
"repo": "cmp-tabby",
"type": "github"
}
},
"editorconfig-nvim": {
"flake": false,
"locked": {
"lastModified": 1673364897,
"narHash": "sha256-pR57tITdVGF4luEmmRYv/XFb35E3KDfcgYRijkPAc+Y=",
"owner": "gpanders",
"repo": "editorconfig.nvim",
"rev": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf",
"type": "github"
},
"original": {
"owner": "gpanders",
"repo": "editorconfig.nvim",
"type": "github"
}
},
"firefox-addons": { "firefox-addons": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
@ -195,22 +131,6 @@
"type": "github" "type": "github"
} }
}, },
"gitsigns-nvim": {
"flake": false,
"locked": {
"lastModified": 1695571272,
"narHash": "sha256-VJCtDnPSo5RgSC+czSIOvqGhpUT0dzvCzbLtup+Ctyo=",
"owner": "lewis6991",
"repo": "gitsigns.nvim",
"rev": "bdeba1cec3faddd89146690c10b9a87949c0ee66",
"type": "github"
},
"original": {
"owner": "lewis6991",
"repo": "gitsigns.nvim",
"type": "github"
}
},
"hardware": { "hardware": {
"locked": { "locked": {
"lastModified": 1711352745, "lastModified": 1711352745,
@ -290,22 +210,6 @@
"type": "github" "type": "github"
} }
}, },
"hop-nvim": {
"flake": false,
"locked": {
"lastModified": 1694283445,
"narHash": "sha256-SnuFeD/lrMxKtpBRPgIwdG0kVF7BWe02PiV7URVDASI=",
"owner": "phaazon",
"repo": "hop.nvim",
"rev": "1a1eceafe54b5081eae4cb91c723abd1d450f34b",
"type": "github"
},
"original": {
"owner": "phaazon",
"repo": "hop.nvim",
"type": "github"
}
},
"lan-mouse": { "lan-mouse": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -327,135 +231,6 @@
"type": "github" "type": "github"
} }
}, },
"lspsaga-nvim": {
"flake": false,
"locked": {
"lastModified": 1665291018,
"narHash": "sha256-jkoEP5jeIZDAK/27gpNTXtW10/Ev9nB5RqUahPhja2Y=",
"owner": "glepnir",
"repo": "lspsaga.nvim",
"rev": "f33bc99d0ed3ed691a58b3339decf4e1933c3f9e",
"type": "github"
},
"original": {
"owner": "glepnir",
"repo": "lspsaga.nvim",
"rev": "f33bc99d0ed3ed691a58b3339decf4e1933c3f9e",
"type": "github"
}
},
"lualine-lsp-progress": {
"flake": false,
"locked": {
"lastModified": 1634947677,
"narHash": "sha256-8HMtydFDzTxsuKvce+bIra9vZ9zHfEBHyR346W635b8=",
"owner": "arkav",
"repo": "lualine-lsp-progress",
"rev": "56842d097245a08d77912edf5f2a69ba29f275d7",
"type": "github"
},
"original": {
"owner": "arkav",
"repo": "lualine-lsp-progress",
"type": "github"
}
},
"lualine-nvim": {
"flake": false,
"locked": {
"lastModified": 1691046210,
"narHash": "sha256-v8finXk+sLNaFMA7pSHhEu0WF5mhPYWHEKhl0IKBv8c=",
"owner": "nvim-lualine",
"repo": "lualine.nvim",
"rev": "45e27ca739c7be6c49e5496d14fcf45a303c3a63",
"type": "github"
},
"original": {
"owner": "nvim-lualine",
"repo": "lualine.nvim",
"type": "github"
}
},
"luasnip": {
"flake": false,
"locked": {
"lastModified": 1695621384,
"narHash": "sha256-5rr5F1PJMqKvIgGPqYx27Id0xW97lZZU1FoEA1rVfjI=",
"owner": "L3MON4D3",
"repo": "LuaSnip",
"rev": "480b032f6708573334f4437d3f83307d143f1a72",
"type": "github"
},
"original": {
"owner": "L3MON4D3",
"repo": "LuaSnip",
"type": "github"
}
},
"myneovim": {
"inputs": {
"cmp-luasnip": "cmp-luasnip",
"cmp-nvim-lsp": "cmp-nvim-lsp",
"cmp-tabby": "cmp-tabby",
"editorconfig-nvim": "editorconfig-nvim",
"flake-utils": [
"flake-utils"
],
"gitsigns-nvim": "gitsigns-nvim",
"hop-nvim": "hop-nvim",
"lspsaga-nvim": "lspsaga-nvim",
"lualine-lsp-progress": "lualine-lsp-progress",
"lualine-nvim": "lualine-nvim",
"luasnip": "luasnip",
"neoformat": "neoformat",
"nix2lua": "nix2lua",
"nixpkgs": [
"nixpkgs-unstable"
],
"nlsp-settings-nvim": "nlsp-settings-nvim",
"nvim-cmp": "nvim-cmp",
"nvim-colorizer": "nvim-colorizer",
"nvim-lspconfig": "nvim-lspconfig",
"nvim-orgmode": "nvim-orgmode",
"nvim-tree-lua": "nvim-tree-lua",
"nvim-web-devicons": "nvim-web-devicons",
"org-bullets-nvim": "org-bullets-nvim",
"plenary-nvim": "plenary-nvim",
"tabby-nvim": "tabby-nvim",
"telescope-live-grep-args-nvim": "telescope-live-grep-args-nvim",
"telescope-nvim": "telescope-nvim",
"theme": "theme"
},
"locked": {
"lastModified": 1713273797,
"narHash": "sha256-OZArDAd/qeIVFXiJxKqjFlCtLjrqBePTgoQLzp2ICNI=",
"ref": "refs/heads/main",
"rev": "6bbb5622166b9179f1a135f65cb91280d294109c",
"revCount": 116,
"type": "git",
"url": "https://git.pleshevski.ru/mynix/neovim"
},
"original": {
"type": "git",
"url": "https://git.pleshevski.ru/mynix/neovim"
}
},
"neoformat": {
"flake": false,
"locked": {
"lastModified": 1695341413,
"narHash": "sha256-b1IHXoRvQu4QCTR+A+KQAhj6wUD5jinjdkxu9w8ukyY=",
"owner": "sbdchd",
"repo": "neoformat",
"rev": "aedb6f9d3f53d5da229095f7d761d749f8c5c7e0",
"type": "github"
},
"original": {
"owner": "sbdchd",
"repo": "neoformat",
"type": "github"
}
},
"nil": { "nil": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
@ -482,11 +257,11 @@
}, },
"nix2lua": { "nix2lua": {
"locked": { "locked": {
"lastModified": 1709128456, "lastModified": 1714950962,
"narHash": "sha256-tRduS+XFI6VceWPQzjkuvlyn/Oe5NsQUS/wyEC69dvk=", "narHash": "sha256-BFXPReb658A4OmuPMMkGN77sTDmXDMnii4IC997ZPvo=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "f152767145e61fea96eddb1b550ab3f25701e0ad", "rev": "65d4a061a42dbbb2cc326a4554dc8bac350999b0",
"revCount": 18, "revCount": 40,
"type": "git", "type": "git",
"url": "https://git.pleshevski.ru/mynix/nix2lua" "url": "https://git.pleshevski.ru/mynix/nix2lua"
}, },
@ -495,6 +270,30 @@
"url": "https://git.pleshevski.ru/mynix/nix2lua" "url": "https://git.pleshevski.ru/mynix/nix2lua"
} }
}, },
"nixeovim": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nix2lua": "nix2lua",
"nixpkgs": [
"nixpkgs-unstable"
]
},
"locked": {
"lastModified": 1715296620,
"narHash": "sha256-H+vrWw2Pf4a7X24ldqWwu3Q10HGygi+dD31S9WySrro=",
"ref": "refs/heads/main",
"rev": "f3926f63655a87d360eac52d7df8b9ef2d6faa73",
"revCount": 57,
"type": "git",
"url": "https://git.pleshevski.ru/pleshevskiy/nixeovim"
},
"original": {
"type": "git",
"url": "https://git.pleshevski.ru/pleshevskiy/nixeovim"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1627814220, "lastModified": 1627814220,
@ -543,151 +342,6 @@
"type": "github" "type": "github"
} }
}, },
"nlsp-settings-nvim": {
"flake": false,
"locked": {
"lastModified": 1692758329,
"narHash": "sha256-Jj74rwBpqdXXykNuvJfESUOL+ntPLtzSSHqh2NcUzDo=",
"owner": "tamago324",
"repo": "nlsp-settings.nvim",
"rev": "2a52e793d4f293c0e1d61ee5794e3ff62bfbbb5d",
"type": "github"
},
"original": {
"owner": "tamago324",
"repo": "nlsp-settings.nvim",
"type": "github"
}
},
"nvim-cmp": {
"flake": false,
"locked": {
"lastModified": 1693063902,
"narHash": "sha256-WGck3By9GhnBUmzLGi2wnKjDreQx5kBOmHCbC5BZhfo=",
"owner": "hrsh7th",
"repo": "nvim-cmp",
"rev": "5dce1b778b85c717f6614e3f4da45e9f19f54435",
"type": "github"
},
"original": {
"owner": "hrsh7th",
"repo": "nvim-cmp",
"type": "github"
}
},
"nvim-colorizer": {
"flake": false,
"locked": {
"lastModified": 1591879145,
"narHash": "sha256-6YrnItxExL2C8pNIdLd+hXCjsB2MbZANwWkah6dreD8=",
"owner": "norcalli",
"repo": "nvim-colorizer.lua",
"rev": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6",
"type": "github"
},
"original": {
"owner": "norcalli",
"repo": "nvim-colorizer.lua",
"type": "github"
}
},
"nvim-lspconfig": {
"flake": false,
"locked": {
"lastModified": 1695879754,
"narHash": "sha256-eUyyB/P52AZz3rl2n9ntGIp3b0x0s/TF/fQZ/30UeC0=",
"owner": "neovim",
"repo": "nvim-lspconfig",
"rev": "c7077400d004c1a424d210af76ce198250db72fd",
"type": "github"
},
"original": {
"owner": "neovim",
"repo": "nvim-lspconfig",
"type": "github"
}
},
"nvim-orgmode": {
"flake": false,
"locked": {
"lastModified": 1669843678,
"narHash": "sha256-zut3orH6okjb9NLvpoQ/S0jDTKGEe41ULXOKjBPqYO0=",
"owner": "nvim-orgmode",
"repo": "orgmode",
"rev": "fc9bb0f5823d01e4008e4b86663772d4148aa9ce",
"type": "github"
},
"original": {
"owner": "nvim-orgmode",
"repo": "orgmode",
"rev": "fc9bb0f5823d01e4008e4b86663772d4148aa9ce",
"type": "github"
}
},
"nvim-tree-lua": {
"flake": false,
"locked": {
"lastModified": 1695716495,
"narHash": "sha256-Fkchn7UuIHPmVFFrx1kzsE2lviJrAFAe9tHu73HnS/w=",
"owner": "kyazdani42",
"repo": "nvim-tree.lua",
"rev": "934469b9b6df369e198fb3016969e56393b0dc07",
"type": "github"
},
"original": {
"owner": "kyazdani42",
"repo": "nvim-tree.lua",
"type": "github"
}
},
"nvim-web-devicons": {
"flake": false,
"locked": {
"lastModified": 1695598844,
"narHash": "sha256-k1oq5TBF0ZAfC1aihw/HLrvOHwZSX8ToDU3aZ3YXdzE=",
"owner": "kyazdani42",
"repo": "nvim-web-devicons",
"rev": "45d0237c427baba8cd05e0ab26d30e2ee58c2c82",
"type": "github"
},
"original": {
"owner": "kyazdani42",
"repo": "nvim-web-devicons",
"type": "github"
}
},
"org-bullets-nvim": {
"flake": false,
"locked": {
"lastModified": 1679902360,
"narHash": "sha256-x6S4WdgfUr7HGEHToSDy3pSHEwOPQalzWhBUipqMtnw=",
"owner": "akinsho",
"repo": "org-bullets.nvim",
"rev": "6e0d60e901bb939eb526139cb1f8d59065132fd9",
"type": "github"
},
"original": {
"owner": "akinsho",
"repo": "org-bullets.nvim",
"type": "github"
}
},
"plenary-nvim": {
"flake": false,
"locked": {
"lastModified": 1694526433,
"narHash": "sha256-s3qsKf05X5W1VdZT1vYXGQNK0UaiI+umWUf06Spe4hw=",
"owner": "nvim-lua",
"repo": "plenary.nvim",
"rev": "9ce85b0f7dcfe5358c0be937ad23e456907d410b",
"type": "github"
},
"original": {
"owner": "nvim-lua",
"repo": "plenary.nvim",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
@ -697,8 +351,8 @@
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"home-manager-unstable": "home-manager-unstable", "home-manager-unstable": "home-manager-unstable",
"lan-mouse": "lan-mouse", "lan-mouse": "lan-mouse",
"myneovim": "myneovim",
"nil": "nil", "nil": "nil",
"nixeovim": "nixeovim",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"wired": "wired" "wired": "wired"
@ -781,70 +435,6 @@
"type": "github" "type": "github"
} }
}, },
"tabby-nvim": {
"flake": false,
"locked": {
"lastModified": 1695278537,
"narHash": "sha256-yzFOD1ERAcZx+PQmBC/aMhHTBUBCccOxRF3x0S6c9nM=",
"owner": "nanozuki",
"repo": "tabby.nvim",
"rev": "9e537762cbb7647357eab22c61c7c5dda00138dd",
"type": "github"
},
"original": {
"owner": "nanozuki",
"repo": "tabby.nvim",
"type": "github"
}
},
"telescope-live-grep-args-nvim": {
"flake": false,
"locked": {
"lastModified": 1693245982,
"narHash": "sha256-L2STMQude8DalHF4fYaJZNjvQHB1UtnQx8Gx2fPKcDA=",
"owner": "nvim-telescope",
"repo": "telescope-live-grep-args.nvim",
"rev": "851c0997d55601f2afd7290db0f90dc364e29f58",
"type": "github"
},
"original": {
"owner": "nvim-telescope",
"repo": "telescope-live-grep-args.nvim",
"type": "github"
}
},
"telescope-nvim": {
"flake": false,
"locked": {
"lastModified": 1695796462,
"narHash": "sha256-ZNkDZLR3oHe/tkAOpWwN3CF5M+3xooYlUuBT2Hndauw=",
"owner": "nvim-telescope",
"repo": "telescope.nvim",
"rev": "84d53dfdbefbdf84e861a288abc71ef8ccafd04e",
"type": "github"
},
"original": {
"owner": "nvim-telescope",
"repo": "telescope.nvim",
"type": "github"
}
},
"theme": {
"flake": false,
"locked": {
"lastModified": 1695478950,
"narHash": "sha256-SV5DTVwcVv6YIb7TGNYwq6rtIG5pFKubK07snXhV7z8=",
"owner": "catppuccin",
"repo": "nvim",
"rev": "3d9a5ed556e289bce6c1fb0af89ec838360641b2",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "nvim",
"type": "github"
}
},
"utils": { "utils": {
"locked": { "locked": {
"lastModified": 1652776076, "lastModified": 1652776076,

View file

@ -40,14 +40,14 @@
}; };
# my neovim configuration # my neovim configuration
myneovim = { nixeovim = {
url = "git+https://git.pleshevski.ru/mynix/neovim"; url = "git+https://git.pleshevski.ru/pleshevskiy/nixeovim";
inputs.nixpkgs.follows = "nixpkgs-unstable"; inputs.nixpkgs.follows = "nixpkgs-unstable";
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
}; };
}; };
outputs = inputs @ { self, flake-utils, nixpkgs, ... }: outputs = { self, flake-utils, nixpkgs, nixeovim, ... } @ inputs:
let inherit (flake-utils.lib) eachSystem system; in let inherit (flake-utils.lib) eachSystem system; in
eachSystem [ system.x86_64-linux ] eachSystem [ system.x86_64-linux ]
(system: (system:
@ -55,12 +55,18 @@
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib; inherit (pkgs) lib;
nixeovimPackage = config: nixeovim.lib.mkNixeovimPackage { inherit system config; };
nixos-rebuild = pkgs.nixos-rebuild.override { nix = pkgs.nixVersions.stable; }; nixos-rebuild = pkgs.nixos-rebuild.override { nix = pkgs.nixVersions.stable; };
localMachines = lib.filterAttrs (h: m: m.config.deployment.targetHost == null) self.nixosConfigurations; localMachines = lib.filterAttrs (h: m: m.config.deployment.targetHost == null) self.nixosConfigurations;
vpsMachines = lib.filterAttrs (h: m: m.config.deployment.targetHost != null) self.nixosConfigurations; vpsMachines = lib.filterAttrs (h: m: m.config.deployment.targetHost != null) self.nixosConfigurations;
in in
{ {
packages = {
neovim-dev = nixeovimPackage ./neovim/dev.nix;
};
apps = lib.mapAttrs apps = lib.mapAttrs
(name: program: { type = "app"; program = toString program; }) (name: program: { type = "app"; program = toString program; })
(flake-utils.lib.flattenTree { (flake-utils.lib.flattenTree {

View file

@ -1,133 +1,6 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let cfg = config.local.programs.editors.neovim; in
cfg = config.local.programs.editors.neovim;
# TODO: add more configs
myneovim = pkgs.myneovim.override {
viAlias = true;
vimAlias = true;
enableDevIcons = true;
enableTabby = true;
enableOrgMode = cfg.orgmode.enable;
extraConfig = ''
aug extra_ftdetect
au!
au BufNewFile,BufRead *.d2 setfiletype d2
au BufNewFile,BufRead *.ncl setfiletype nickel
au BufNewFile,BufRead *.psql setfiletype psql
aug END
'';
plugins = with pkgs.myneovim.nix2lua; (lib.mkMerge [
{
nvimTree.settings = {
renderer = {
group_empty = true;
full_name = true;
};
tab.sync = {
open = true;
close = true;
};
};
telescope.settings = {
extensions.live_grep_args = {
auto_quoting = true;
mappings.i = {
"<C-K>" = join "." [
(mkCall "require" [ "telescope-live-grep-args.actions" ])
(mkCall "quote_prompt" [ ])
];
};
};
};
lspSaga.settings = {
border_style = "rounded";
symbol_in_winbar.enable = false;
code_action_lightbulb.enable = false;
code_action_keys = { quit = "<Esc>"; };
definition_action_keys = { quit = "<Esc>"; };
rename_action_quit = "<C-c>";
};
lualine.settings = {
options.ignore_focus = [ "NvimTree" ];
sections = {
lualine_a = [
[ "filename" (mkNamedField "path" 1) ]
];
lualine_b = [ "branch" "diff" "diagnostics" ];
lualine_c = [ "lsp_progress" ];
lualine_x = [ "filesize" "filetype" ];
lualine_y = [ "progress" ];
lualine_z = [ "location" "mode" ];
};
};
}
(lib.mkIf cfg.orgmode.enable {
orgmode.settings = {
org_agenda_files = [ "~/orgs/**/*" ];
org_default_notes_file = "~/orgs/refile.org";
win_split_mode = "tabnew";
org_hide_leading_stars = true;
};
})
(lib.mkIf cfg.ltex.enable {
lspConfig.servers.ltex = {
language = "en-US";
languageToolHttpServerUri = "http://localhost:8081";
};
})
(lib.mkIf cfg.nix.enable {
lspConfig.servers.nil_ls = { };
})
(lib.mkIf cfg.rust.enable {
lspConfig.servers.rust_analyzer = {
settings.rust-analyzer = {
"server.path" = "rust-analyzer";
"updates.prompt" = false;
"updates.checkOnStartup" = false;
"checkOnSave.enable" = true;
"checkOnSave.command" = "clippy";
"cargo.autoreload" = true;
};
};
})
(lib.mkIf (cfg.typescript.enable || cfg.vue.enable) {
lspConfig.servers = {
tsserver = { };
eslint = { };
};
})
(lib.mkIf cfg.vue.enable {
lspConfig.servers.volar = {
init_options = {
typescript.tsdk = "./node_modules/typescript/lib";
};
};
})
(lib.mkIf cfg.deno.enable {
lspConfig.servers.denols = {
root_dir = mkCall "root_pattern" [ "deno.json" "deno.jsonc" ];
};
})
(lib.mkIf cfg.python.enable {
lspConfig.servers.pylsp = { };
})
(lib.mkIf cfg.nickel.enable {
lspConfig.servers.nickel_ls = { };
})
]);
};
in
{ {
options.local.programs.editors.neovim = with lib; { options.local.programs.editors.neovim = with lib; {
enable = mkEnableOption "neovim"; enable = mkEnableOption "neovim";
@ -137,23 +10,9 @@ in
default = false; default = false;
}; };
ltex.enable = mkEnableOption "ltex language server"; ltex.enable = mkEnableOption "ltex language server";
orgmode.enable = mkEnableOption "orgmode";
nix.enable = mkEnableOption "nix";
rust.enable = mkEnableOption "rust";
typescript.enable = mkEnableOption "typescript";
vue.enable = mkEnableOption "vue";
deno.enable = mkEnableOption "deno";
python.enable = mkEnableOption "python";
nickel.enable = mkEnableOption "nickel";
}; };
config = lib.mkIf cfg.enable (lib.mkMerge [ config = lib.mkIf cfg.enable (lib.mkMerge [
{
home.packages = [ myneovim ];
}
(lib.mkIf cfg.ltex.enable { (lib.mkIf cfg.ltex.enable {
home.packages = [ pkgs.ltex-ls ]; home.packages = [ pkgs.ltex-ls ];
}) })

125
neovim/dev.nix Normal file
View file

@ -0,0 +1,125 @@
{ config, modulesPath, lib, ... }:
let
inherit (lib.mod) ctrl;
inherit (lib.nix2lua) lambda0 set pipe1 require call call0;
mkLineLimiterGroup = { limit, pattern }: {
"line-limiter-${toString limit}" = {
event = [ "BufNewFile" "BufRead" ];
inherit pattern;
callback = lambda0 (set "vim.wo.colorcolumn" (toString limit));
};
};
in
{
imports = [
"${modulesPath}/profiles/recommended.nix"
];
vim.namedCmd.extra-ftdetect = ''
aug extra_ftdetect
au!
au BufNewFile,BufRead *.d2 setfiletype d2
au BufNewFile,BufRead *.ncl setfiletype nickel
au BufNewFile,BufRead *.psql setfiletype psql
aug END
'';
# Enable fast navigation between windows
vim.keymap.set = map (k: { mode = "n"; lhs = ctrl k; rhs = "${ctrl "w"}${k}"; }) [ "h" "l" "j" "k" ];
vim.augroup = lib.mkMerge [
(mkLineLimiterGroup {
limit = 101;
pattern = [
"*.nix"
"*.ts"
"*.tsx"
"*.js"
"*.jsx"
"*.rs"
"*.hs"
];
})
(mkLineLimiterGroup {
limit = 81;
pattern = [
"*.json"
"*.yml"
"*.yaml"
"*.md"
"*.html"
"*.css"
"*.scss"
"*.less"
];
})
];
plugins.navigation = {
nvim-tree.settings = {
renderer = {
group_empty = true;
full_name = true;
};
tab.sync = {
open = true;
close = true;
};
};
telescope.extensions.telescope-live-grep-args-nvim.settings = {
auto_quoting = true;
mappings.i = {
"<C-K>" = pipe1
(require "telescope-live-grep-args.actions")
(call0 "quote_prompt")
;
};
};
};
plugins.language-server.lspconfig.serverSettings = {
nil_ls = { };
rust_analyzer = {
settings.rust-analyzer = {
"server.path" = "rust-analyzer";
"updates.prompt" = false;
"updates.checkOnStartup" = false;
"checkOnSave.enable" = true;
"checkOnSave.command" = "clippy";
"cargo.autoreload" = true;
};
};
tsserver = { };
eslint = {
# TODO: on attach
/*
vim.cmd([[
aug eslint_fix
au!
au BufWritePre *.tsx,*.ts,*.jsx,*.js silent! EslintFixAll
aug END
]])
*/
};
volar = {
init_options = {
typescript.tsdk = "./node_modules/typescript/lib";
};
};
ltex = {
language = "en-US";
languageToolHttpServerUri = "http://localhost:8081";
};
pylsp = { };
denols = {
root_dir = call "${config.plugin.nvim-lspconfig.varName}.util.root_pattern" [ "deno.json" "deno.jsonc" ];
};
};
}

View file

@ -2,7 +2,6 @@
{ {
nixpkgs.overlays = lib.mkAfter [ nixpkgs.overlays = lib.mkAfter [
inputs.myneovim.overlays.default
inputs.nil.overlays.default inputs.nil.overlays.default
inputs.wired.overlays.default inputs.wired.overlays.default
]; ];
@ -74,13 +73,6 @@
enable = lib.mkDefault true; enable = lib.mkDefault true;
defaultEditor = lib.mkDefault true; defaultEditor = lib.mkDefault true;
ltex.enable = lib.mkDefault true; ltex.enable = lib.mkDefault true;
nix.enable = lib.mkDefault true;
rust.enable = lib.mkDefault true;
typescript.enable = lib.mkDefault true;
vue.enable = lib.mkDefault true;
deno.enable = lib.mkDefault true;
python.enable = lib.mkDefault true;
}; };
local.programs.file-managers.vifm.enable = lib.mkDefault true; local.programs.file-managers.vifm.enable = lib.mkDefault true;