Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 25 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,33 @@
let
pkgs = import nixpkgs {
inherit system;
overlays = [ inputs.devshell.overlay ];
overlays = [
inputs.devshell.overlay
(final: prev: rec {
python3 = prev.python3.override
{
packageOverrides = final: prev: {
aiohttp = prev.aiohttp.overrideAttrs
(old: {
checkInputs = builtins.filter (pkg: pkg != inputs.trustme) old.checkInputs;
});
pyopenssl = prev.pyopenssl.overrideAttrs
(old: {
meta = old.meta // { broken = false; };
});
};
};
})
];
};
pyEnv = (pkgs.python3.withPackages
(ps: with ps; [ black pylint typer colorama shellingham ]));
sysdo = pkgs.writeShellScriptBin "sysdo" ''
cd $PRJ_ROOT && ${pyEnv}/bin/python3 bin/do.py $@
'';
(ps: with ps;
[ black pylint typer colorama shellingham ]));
sysdo = pkgs.writeShellScriptBin
"sysdo"
''
cd $PRJ_ROOT && ${pyEnv}/bin/python3 bin/do.py $@
'';
in
{
devShell = pkgs.devshell.mkShell {
Expand Down
146 changes: 107 additions & 39 deletions modules/home-manager/vim/plugins/coc/default.nix
Original file line number Diff line number Diff line change
@@ -1,43 +1,111 @@
{ config, pkgs, lib, ... }: {
# link coc-settings to the right location
xdg.configFile."nvim/coc-settings.json".source = ./coc-settings.json;

{ pkgs, ... }: {
programs.neovim =
{
extraPackages = with pkgs; [
rubyPackages.solargraph
nodePackages.pyright
rnix-lsp
fzf
];
plugins = with pkgs.vimPlugins; [
(config.lib.vimUtils.pluginWithCfg {
plugin = coc-nvim;
file = ./coc-nvim.vim;
})
coc-css
coc-eslint
coc-fzf
coc-git
coc-go
coc-html
coc-java
coc-json
coc-lua
coc-pairs
coc-prettier
coc-pyright # python
coc-r-lsp
coc-rls
coc-smartf
coc-snippets
coc-solargraph
coc-tslint
coc-tsserver # js/ts
coc-vetur # vuejs
coc-vimlsp # vimL
coc-vimtex # latex
coc-yaml
];
coc = {
enable = true;

package = pkgs.vimUtils.buildVimPluginFrom2Nix
{
pname = "coc.nvim";
version = "2022-05-21";
src = pkgs.fetchFromGitHub {
owner = "neoclide";
repo = "coc.nvim";
rev = "791c9f673b882768486450e73d8bda10e391401d";
sha256 = "sha256-MobgwhFQ1Ld7pFknsurSFAsN5v+vGbEFojTAYD/kI9c=";
};
meta.homepage = "https://github.com/neoclide/coc.nvim/";
};

settings = {
"coc.preferences.rootPatterns" = [ ".git" ];
"explorer.keyMappings.global" = {
"<cr>" = [ "expandable?" [ "expanded?" "collapse" "expand" ] "open" ];
};

"explorer.file.showHiddenFiles" = true;
"explorer.git.icon.status.added" = "✚";
"explorer.git.icon.status.copied" = "➜";
"explorer.git.icon.status.deleted" = "✖";
"explorer.git.icon.status.ignored" = "☒";
"explorer.git.icon.status.mixed" = "✹";
"explorer.git.icon.status.modified" = "✹";
"explorer.git.icon.status.renamed" = "➜";
"explorer.git.icon.status.unmerged" = "═";
"explorer.git.icon.status.untracked" = "?";
"explorer.git.showIgnored" = true;
"explorer.icon.enableNerdfont" = true;
"explorer.position" = "right";

"languageserver" = {
"nix" = {
"command" = "rnix-lsp";
"filetypes" = [ "nix" ];
};
};
};

pluginConfig = ''
" CoC Extensions
let g:coc_global_extensions=[
\ 'coc-clangd',
\ 'coc-css',
\ 'coc-dictionary',
\ 'coc-docker',
\ 'coc-elixir',
\ 'coc-eslint',
\ 'coc-explorer',
\ 'coc-go',
\ 'coc-html',
\ 'coc-java',
\ 'coc-java-debug',
\ 'coc-json',
\ 'coc-kotlin',
\ 'coc-lists',
\ 'coc-marketplace',
\ 'coc-omnisharp',
\ 'coc-prettier',
\ 'coc-pyright',
\ 'coc-rust-analyzer',
\ 'coc-sh',
\ 'coc-texlab',
\ 'coc-tsserver',
\ 'coc-word',
\ 'coc-yaml',
\ ]
set updatetime=300
set shortmess+=c
" Use tab for trigger completion with characters ahead and navigate.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Formatting
vmap <C-F> <Plug>(coc-format-selected)
xmap <C-F> :call CocAction('format')<CR>
nmap <C-F> :call CocAction('format')<CR>
" Hover and rename
nmap <silent> <F6> <Plug>(coc-rename)
nnoremap <silent> K :call CocAction('doHover')<CR>
" Go to symbol in (document|project)
nmap <silent> S :CocList symbols<CR>
" CoC Explorer
function! CocExploreCwd()
let cwd = substitute(execute(":pwd"), '\n', "", "")
exe 'CocCommand explorer ' . cwd
endfunction
map <S-T> :call CocExploreCwd()<CR>
'';
};
};
}
21 changes: 20 additions & 1 deletion modules/overlays.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
{ inputs, nixpkgs, stable, ... }: {
{ inputs
, nixpkgs
, stable
, ...
}: {
nixpkgs.overlays = [
(final: prev: {
# expose stable packages via pkgs.stable
stable = import inputs.stable { system = prev.system; };
})
(final: prev: rec {
python3 = prev.python3.override
{
packageOverrides = final: prev: {
aiohttp = prev.aiohttp.overrideAttrs
(old: {
checkInputs = builtins.filter (pkg: pkg != inputs.trustme) old.checkInputs;
});
pyopenssl = prev.pyopenssl.overrideAttrs
(old: {
meta = old.meta // { broken = false; };
});
};
};
})
];
}