This repository has been archived on 2025-01-07. You can view files and clone it, but cannot push or open issues or pull requests.
opdavies.nvim/lib/default.nix

276 lines
5.2 KiB
Nix
Raw Normal View History

{ inputs, self }:
2024-05-15 18:53:51 +00:00
let
inherit (inputs.nixpkgs) legacyPackages;
in
rec {
mkVimPlugin =
{ system }:
2024-03-18 20:34:42 +00:00
let
inherit (pkgs) vimUtils;
inherit (vimUtils) buildVimPlugin;
2024-03-18 20:34:42 +00:00
pkgs = legacyPackages.${system};
2024-05-15 18:53:51 +00:00
in
buildVimPlugin {
name = "opdavies";
postInstall = ''
rm -rf $out/.envrc
rm -rf $out/.gitignore
rm -rf $out/.luacheckrc
rm -rf $out/.markdownlint.yaml
2024-01-25 23:12:29 +00:00
rm -rf $out/CHANGELOG.md
rm -rf $out/flake.lock
rm -rf $out/flake.nix
rm -rf $out/lib
rm -rf $out/overlays
rm -rf $out/run
rm -rf $out/stylua.toml
rm -rf $out/todo
'';
src = ../.;
};
2024-05-15 18:53:51 +00:00
mkNeovimPlugins =
{ system }:
2024-03-18 20:34:42 +00:00
let
pkgs = import inputs.nixpkgs {
inherit system;
2024-03-18 20:34:42 +00:00
config.allowUnfree = true;
overlays = [ (import "${self}/overlays/vim-plugins.nix") ];
2024-03-18 20:34:42 +00:00
};
2024-03-18 20:34:42 +00:00
opdavies-nvim = mkVimPlugin { inherit system; };
2024-05-15 18:53:51 +00:00
in
with pkgs.vimPlugins;
2024-05-15 18:53:51 +00:00
[
comment-nvim
conf-vim
dial-nvim
edit-alternate-vim
fidget-nvim
gitsigns-nvim
harpoon
impatient-nvim
mini-nvim
neodev-nvim
nvim-spectre
nvim-web-devicons
oil-nvim
refactoring-nvim
sort-nvim
standard-vim
tabline-vim
treesj
undotree
vim-abolish
vim-autoread
vim-eunuch
vim-highlightedyank
vim-just
vim-nix
vim-obsession
vim-pasta
vim-repeat
vim-sleuth
2024-09-15 23:00:46 +00:00
vim-sort-motion
vim-terraform
2024-09-15 22:11:22 +00:00
vim-textobj-indent
vim-textobj-user
vim-textobj-xmlattr
vim-unimpaired
vim-zoom
2024-03-18 20:34:42 +00:00
# Testing
vim-test
2024-03-18 20:34:42 +00:00
# Git
committia-vim
diffview-nvim
vim-fugitive
2024-03-18 20:34:42 +00:00
# Debugging
nvim-dap
nvim-dap-ui
nvim-dap-virtual-text
2024-03-18 20:34:42 +00:00
# Treesitter
(pkgs.vimPlugins.nvim-treesitter.withPlugins (
plugins: with plugins; [
bash
comment
css
csv
dockerfile
gitattributes
gitignore
go
html
javascript
json
kdl
lua
luadoc
make
markdown
markdown_inline
nix
php
phpdoc
query
rst
scss
sql
terraform
twig
typescript
vim
vimdoc
vue
xml
yaml
]
))
nvim-treesitter-context
nvim-treesitter-textobjects
2024-03-18 20:34:42 +00:00
# LSP, linting and formatting
conform-nvim
lsp-status-nvim
nvim-lint
nvim-lspconfig
2024-03-18 20:34:42 +00:00
# Completion
cmp-buffer
cmp-calc
cmp-cmdline
cmp-nvim-lsp
cmp-path
cmp-treesitter
cmp_luasnip
lspkind-nvim
nvim-cmp
2024-03-18 20:34:42 +00:00
# Snippets
friendly-snippets
luasnip
2024-03-18 20:34:42 +00:00
# Telescope
plenary-nvim
popup-nvim
telescope-frecency-nvim
telescope-fzf-native-nvim
telescope-live-grep-args-nvim
telescope-nvim
telescope-ui-select-nvim
2024-03-18 20:34:42 +00:00
# Databases
vim-dadbod
vim-dadbod-ui
vim-dadbod-completion
2024-03-18 20:34:42 +00:00
# Themes
catppuccin-nvim
2024-03-18 20:34:42 +00:00
# Configuration.
opdavies-nvim
];
2024-05-15 18:53:51 +00:00
mkExtraPackages =
{ system }:
2024-03-18 20:34:42 +00:00
let
inherit (pkgs) nodePackages lua54Packages php82Packages;
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
2024-05-15 18:53:51 +00:00
in
with pkgs;
2024-05-15 18:53:51 +00:00
[
2024-03-18 20:34:42 +00:00
# Languages
nodePackages.typescript
nodejs-slim
php81
2024-03-18 20:34:42 +00:00
# Language servers
gopls
lua-language-server
2024-03-18 20:34:42 +00:00
lua54Packages.luacheck
marksman
nil
2024-03-18 20:34:42 +00:00
nodePackages."@tailwindcss/language-server"
nodePackages.bash-language-server
nodePackages.dockerfile-language-server-nodejs
nodePackages.intelephense
nodePackages.typescript-language-server
nodePackages.vls
nodePackages.volar
nodePackages.vscode-langservers-extracted
nodePackages.vue-language-server
nodePackages.yaml-language-server
phpactor
terraform-ls
2024-03-18 20:34:42 +00:00
# Formatters
black
eslint_d
nixfmt-rfc-style
nodePackages.prettier
stylua
yamlfmt
2024-03-18 20:34:42 +00:00
# Tools
2024-04-04 17:52:03 +00:00
hadolint
html-tidy
2024-03-18 20:34:42 +00:00
nodePackages.jsonlint
nodePackages.markdownlint-cli
php82Packages.php-codesniffer
php82Packages.phpstan
proselint
shellcheck
yamllint
2024-03-18 20:34:42 +00:00
];
mkExtraConfig = ''
lua << EOF
require 'opdavies'
EOF
'';
2024-05-15 18:53:51 +00:00
mkNeovim =
{ system }:
2024-03-18 20:34:42 +00:00
let
inherit (pkgs) lib neovim;
2024-03-18 20:34:42 +00:00
extraPackages = mkExtraPackages { inherit system; };
pkgs = legacyPackages.${system};
start = mkNeovimPlugins { inherit system; };
2024-05-15 18:53:51 +00:00
in
neovim.override {
configure = {
customRC = mkExtraConfig;
2024-05-15 18:53:51 +00:00
packages.main = {
inherit start;
};
};
2024-05-15 18:53:51 +00:00
extraMakeWrapperArgs = ''--suffix PATH : "${lib.makeBinPath extraPackages}"'';
};
2024-05-15 18:53:51 +00:00
mkHomeManager =
{ system }:
2024-03-18 20:34:42 +00:00
let
extraConfig = mkExtraConfig;
extraPackages = mkExtraPackages { inherit system; };
plugins = mkNeovimPlugins { inherit system; };
2024-05-15 18:53:51 +00:00
in
{
2024-03-18 20:34:42 +00:00
inherit extraConfig extraPackages plugins;
2024-03-18 20:34:42 +00:00
enable = true;
};
}