fully fleshed out nixd settings and switch to nvim-cmp from COQ. Also updated rebuild to work for both home and system configs

This commit is contained in:
pagedmov
2024-11-07 00:30:18 -05:00
parent fc99570fdc
commit f9fe7155de
4 changed files with 83 additions and 36 deletions

View File

@@ -6,13 +6,15 @@
pkgs.writeShellApplication { pkgs.writeShellApplication {
name = "rebuild"; name = "rebuild";
text = '' text = ''
[ $# -eq 0 ] && echo "Usage: rebuild -h for home config, rebuild -s for sys config"
scheck && runbg aplay ${self}/assets/sound/nixswitch-start.wav scheck && runbg aplay ${self}/assets/sound/nixswitch-start.wav
set -e set -e
nh os switch -H ${host} "$HOME"/.sysflake hooray() { scheck && runbg aplay ${self}/assets/sound/update.wav }
if sudo nixos-rebuild switch --flake "$HOME/.sysflake#${host}"; then damn() { scheck && runbg aplay ${self}/assets/sound/error.wav }
scheck && runbg aplay ${self}/assets/sound/update.wav case $1 in
else "-h" ) if nh home switch -c ${host}Home "$FLAKEPATH"; then hooray; else damn; fi;;
scheck && runbg aplay ${self}/assets/sound/error.wav "-s" ) if nh os switch -H ${host} "$FLAKEPATH"; then hooray; else damn; fi;;
fi * ) echo "Usage: rebuild -h for home config, rebuild -s for sys config";;
esac
''; '';
} }

View File

@@ -3,7 +3,7 @@
plugins.coq-nvim = { plugins.coq-nvim = {
enable = true; enable = true;
settings = { settings = {
auto_start = true; auto_start = false;
}; };
}; };
}; };

View File

@@ -5,10 +5,10 @@
./alpha.nix ./alpha.nix
./haskell.nix ./haskell.nix
./vim-matchup.nix ./vim-matchup.nix
./coq.nix # ./coq.nix
./barbar.nix ./barbar.nix
./cmp.nix ./cmp.nix
( import ./lsp.nix { inherit host self; }) ./lsp.nix
./lualine.nix ./lualine.nix
./plugins.nix ./plugins.nix
./nvim-tree.nix ./nvim-tree.nix

View File

@@ -1,37 +1,82 @@
{ host, ... }:
let
flakePath = builtins.getEnv "FLAKEPATH";
in
{ {
programs.nixvim = { programs.nixvim = {
plugins.lsp = { plugins = {
enable = true; cmp-snippy.enable = true;
servers = { cmp = {
bashls.enable = true; enable = true;
ccls.enable = true; settings = {
clangd.enable = true; mapping = {
cmake.enable = true; __raw = ''
html.enable = true; cmp.mapping.preset.insert({
jsonls.enable = true; ['<C-o>'] = cmp.mapping.close_docs(),
lua_ls.enable = true; ['<C-i>'] = cmp.mapping.open_docs(),
marksman.enable = true; ['<C-j>'] = cmp.mapping.scroll_docs(-4),
nixd = { ['<C-k>'] = cmp.mapping.scroll_docs(4),
enable = true; ['<C-Space>'] = cmp.mapping.complete(),
settings = { ['<C-e>'] = cmp.mapping.abort(),
nixd = { ['<CR>'] = function(fallback)
nixpkgs.expr = "import <nixpkgs> { }"; if cmp.visible() then
formatting.command = "nixfmt"; cmp.confirm()
else
fallback()
end
end, -- Added a comma here
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end, -- Added a comma here
['<S-Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end -- No comma needed for the last item
})
'';
};
completion = {
keyword_length = 3;
};
window = {
completion.border = "rounded";
};
};
};
lsp = {
enable = true;
servers = {
bashls.enable = true;
ccls.enable = true;
clangd.enable = true;
cmake.enable = true;
html.enable = true;
jsonls.enable = true;
lua_ls.enable = true;
marksman.enable = true;
nixd = {
enable = true;
settings = {
nixd = {
nixpkgs.expr = "import <nixpkgs> { }";
formatting.command = "nixfmt";
};
options = { options = {
# uses Xenon config because it has every option exposed to it
nixos.expr = "(builtins.getFlake \"github:pagedMov/nixos-config\").nixosConfigurations.xenon.options"; nixos.expr = "(builtins.getFlake \"github:pagedMov/nixos-config\").nixosConfigurations.xenon.options";
home.expr = "(builtins.getFlake \"github:pagedMov/nixos-config\").homeConfigurations.xenonHome.options";
}; };
}; };
}; };
}; pyright.enable = true;
pyright.enable = true; sqls.enable = true;
sqls.enable = true; hls = {
hls = { enable = true;
enable = true; installGhc = true;
installGhc = true; };
}; };
}; };
}; };