nix #11

Manually merged
geoffrey merged 113 commits from nix into main 2023-12-09 21:43:01 +01:00
3 changed files with 19 additions and 14 deletions
Showing only changes of commit 41c3266ee2 - Show all commits

View file

@ -7,6 +7,8 @@
c = true;
docker = true;
fpga = true;
perl = true;
php = true;
python = true;
};
extra = true;

View file

@ -1,9 +1,8 @@
{ pkgs, lib, config, ... }:
let
nixvim = import (builtins.fetchGit {
# UPST Ready to create a MR once the tests have ran
url = "https://github.com/GeoffreyFrogeye/nixvim";
ref = "perlls";
url = "https://github.com/nix-community/nixvim";
rev = "c96d7b46d05a78e695ed1c725d1596b65509b4f9"; # 24.05 Anythin after this commit works
});
vim-shot-f = pkgs.vimUtils.buildVimPlugin {
pname = "vim-shot-f";
@ -99,10 +98,10 @@ in
gS = "search_history";
gC = "commands";
gr = "lsp_references";
ge = "diagnostics";
# ga = "lsp_code_actions";
# ge = "lsp_document_diagnostics";
# gE = "lsp_workspace_diagnostics";
# FIXME Above makes nvim crash on startup, action is not provided
# TODO Above makes nvim crash on startup, action is not provided
gd = "lsp_definitions";
gs = "lsp_document_symbols";
};
@ -157,14 +156,14 @@ in
};
};
servers = {
ansiblels.enable = true; # Ansible
ansiblels.enable = config.frogeye.dev.ansible; # Ansible
bashls.enable = true; # Bash
jsonls.enable = true; # JSON
lua-ls.enable = true; # Lua (for Neovim debugging)
perlpls.enable = true; # Perl
pylsp = lib.mkIf config.frogeye.dev.python {
perlpls.enable = config.frogeye.dev.perl; # Perl
pylsp = {
# Python
enable = true;
enable = config.frogeye.dev.python;
settings.plugins = {
black.enabled = true;
flake8 = {
@ -188,20 +187,21 @@ in
"--disallow-untyped-calls"
"--disallow-incomplete-defs"
"--disallow-untyped-decorators"
true
];
};
# FIXME Somehow no warning is shown
# TODO Could add some, could also remove some
};
};
phpactor.enable = true; # PHP
phpactor.enable = config.frogeye.dev.php; # PHP
rnix-lsp.enable = true; # Nix
# TODO Something for SQL. sqls is deprecated, sqlls is not in Nixpkgs. Probably needs a DB connection configured anyways?
yamlls.enable = true; # YAML
# TODO Check out none-ls
};
# FIXME vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') as onAttach... is it needed?
# FIXME flags = { debounce_text_changes = 150 } is the default value ok? Maybe it was actually ignored
onAttach = ''
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
''; # Seems needed for auto-completion with nvim-compe
};
nvim-lightbulb = {
# Shows a lightbulb whenever a codeAction is available under the cursor
@ -289,13 +289,14 @@ in
] ++ lib.optionals config.frogeye.dev.c [
nvim-dap # Debug Adapter Protocol client
] ++ lib.optionals config.frogeye.dev.ansible [
ansible-vim # FIXME See if it doesn't require to do ./UltiSnips/generate.sh
ansible-vim # TODO Doesn't have snippets
];
extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [
./vim/feline.lua
./vim/symbols-outline-nvim.lua
./vim/lsp_signature-nvim.lua
./vim/nvim-ts-rainbow.lua
./vim/nvim-compe.lua
];
extraConfigVim = ''
" GENERAL

View file

@ -30,6 +30,8 @@
c = lib.mkEnableOption "C/C++ dev stuff";
docker = lib.mkEnableOption "Docker dev stuff";
fpga = lib.mkEnableOption "FPGA dev stuff";
perl = lib.mkEnableOption "Perl dev stuff";
php = lib.mkEnableOption "PHP dev stuff";
python = lib.mkEnableOption "Python dev stuff";
};
shellAliases = lib.mkOption {