mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-25 21:30:52 +01:00
feat: move neovim fmt to nixfmt
This commit is contained in:
parent
65bf3fc0a8
commit
32b92ec71d
1 changed files with 108 additions and 59 deletions
|
@ -1,7 +1,12 @@
|
||||||
{ pkgs, home, lib, config, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
home,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.luj.programs.neovim;
|
cfg = config.luj.programs.neovim;
|
||||||
|
|
||||||
in
|
in
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
|
@ -11,7 +16,12 @@ with lib;
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
home.packages = with pkgs; [ nixfmt git nodejs ripgrep gcc ];
|
home.packages = with pkgs; [
|
||||||
|
git
|
||||||
|
nodejs
|
||||||
|
ripgrep
|
||||||
|
gcc
|
||||||
|
];
|
||||||
|
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -23,62 +33,93 @@ with lib;
|
||||||
coc = {
|
coc = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
coc.preferences.formatOnSaveFiletypes = [ "nix" "rust" "sql" "python" "haskell" ];
|
coc.preferences.formatOnSaveFiletypes = [
|
||||||
|
"nix"
|
||||||
|
"rust"
|
||||||
|
"sql"
|
||||||
|
"python"
|
||||||
|
"haskell"
|
||||||
|
];
|
||||||
rust-analyzer.enable = true;
|
rust-analyzer.enable = true;
|
||||||
rust-analyzer.cargo.allFeatures = true;
|
rust-analyzer.cargo.allFeatures = true;
|
||||||
rust-analyzer.checkOnSave.allTargets = true;
|
rust-analyzer.checkOnSave.allTargets = true;
|
||||||
languageserver =
|
languageserver = {
|
||||||
{
|
python = {
|
||||||
python = {
|
command = "pyright";
|
||||||
command = "pyright";
|
filetypes = [
|
||||||
filetypes = [ "py" "python" ];
|
"py"
|
||||||
};
|
"python"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
haskell = {
|
haskell = {
|
||||||
command = "haskell-language-server-wrapper";
|
command = "haskell-language-server-wrapper";
|
||||||
args = [ "--lsp" ];
|
args = [ "--lsp" ];
|
||||||
rootPatterns = [
|
rootPatterns = [
|
||||||
"*.cabal"
|
"*.cabal"
|
||||||
"cabal.project"
|
"cabal.project"
|
||||||
"hie.yaml"
|
"hie.yaml"
|
||||||
".stack.yaml"
|
".stack.yaml"
|
||||||
];
|
];
|
||||||
filetypes = [ "haskell" "lhaskell" "hs" "lhs" ];
|
filetypes = [
|
||||||
settings = {
|
"haskell"
|
||||||
haskell = {
|
"lhaskell"
|
||||||
checkParents = "CheckOnSave";
|
"hs"
|
||||||
checkProject = true;
|
"lhs"
|
||||||
maxCompletions = 40;
|
];
|
||||||
formattingProvider = "ormolu";
|
settings = {
|
||||||
};
|
haskell = {
|
||||||
};
|
checkParents = "CheckOnSave";
|
||||||
};
|
checkProject = true;
|
||||||
|
maxCompletions = 40;
|
||||||
go = {
|
formattingProvider = "ormolu";
|
||||||
command = "gopls";
|
|
||||||
rootPatterns = [ "go.work" "go.mod" ".vim/" ".git/" ".hg/" ];
|
|
||||||
filetypes = [ "go" ];
|
|
||||||
initializationOptions = {
|
|
||||||
usePlaceholders = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nix = {
|
|
||||||
command = "nixd";
|
|
||||||
filetypes = [ "nix" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
ccls = {
|
|
||||||
command = "ccls";
|
|
||||||
filetypes = [ "c" "cpp" "objc" "objcpp" ];
|
|
||||||
rootPatterns = [ ".ccls" "compile_commands.json" ".vim/" ".git/" ".hg/" ];
|
|
||||||
initializationOptions = {
|
|
||||||
cache = {
|
|
||||||
directory = "/tmp/ccls";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
go = {
|
||||||
|
command = "gopls";
|
||||||
|
rootPatterns = [
|
||||||
|
"go.work"
|
||||||
|
"go.mod"
|
||||||
|
".vim/"
|
||||||
|
".git/"
|
||||||
|
".hg/"
|
||||||
|
];
|
||||||
|
filetypes = [ "go" ];
|
||||||
|
initializationOptions = {
|
||||||
|
usePlaceholders = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
command = "nixd";
|
||||||
|
filetypes = [ "nix" ];
|
||||||
|
settings.nixd.formatting.command = [ "nixfmt" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
ccls = {
|
||||||
|
command = "ccls";
|
||||||
|
filetypes = [
|
||||||
|
"c"
|
||||||
|
"cpp"
|
||||||
|
"objc"
|
||||||
|
"objcpp"
|
||||||
|
];
|
||||||
|
rootPatterns = [
|
||||||
|
".ccls"
|
||||||
|
"compile_commands.json"
|
||||||
|
".vim/"
|
||||||
|
".git/"
|
||||||
|
".hg/"
|
||||||
|
];
|
||||||
|
initializationOptions = {
|
||||||
|
cache = {
|
||||||
|
directory = "/tmp/ccls";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -98,11 +139,12 @@ with lib;
|
||||||
pears-nvim
|
pears-nvim
|
||||||
nvim-tree-lua
|
nvim-tree-lua
|
||||||
|
|
||||||
(nvim-treesitter.withPlugins (ps: with ps; [
|
(nvim-treesitter.withPlugins (
|
||||||
tree-sitter-nix
|
ps: with ps; [
|
||||||
tree-sitter-python
|
tree-sitter-nix
|
||||||
]))
|
tree-sitter-python
|
||||||
|
]
|
||||||
|
))
|
||||||
|
|
||||||
vim-lastplace
|
vim-lastplace
|
||||||
vim-nix
|
vim-nix
|
||||||
|
@ -120,7 +162,15 @@ with lib;
|
||||||
rust-vim
|
rust-vim
|
||||||
];
|
];
|
||||||
|
|
||||||
extraPackages = with pkgs; [ rust-analyzer pkgs.nixd pyright nixpkgs-fmt ormolu ccls gopls ];
|
extraPackages = with pkgs; [
|
||||||
|
rust-analyzer
|
||||||
|
pkgs.nixd
|
||||||
|
pyright
|
||||||
|
ormolu
|
||||||
|
ccls
|
||||||
|
gopls
|
||||||
|
unstable.nixfmt-rfc-style
|
||||||
|
];
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
luafile ${./settings.lua}
|
luafile ${./settings.lua}
|
||||||
|
@ -128,4 +178,3 @@ with lib;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue