diff --git a/modules/home/scripts/nix/rebuild.nix b/modules/home/scripts/nix/rebuild.nix index 06f863f..2f6af0d 100755 --- a/modules/home/scripts/nix/rebuild.nix +++ b/modules/home/scripts/nix/rebuild.nix @@ -6,13 +6,15 @@ pkgs.writeShellApplication { name = "rebuild"; text = '' + [ $# -eq 0 ] && echo "Usage: rebuild -h for home config, rebuild -s for sys config" scheck && runbg aplay ${self}/assets/sound/nixswitch-start.wav set -e - nh os switch -H ${host} "$HOME"/.sysflake - if sudo nixos-rebuild switch --flake "$HOME/.sysflake#${host}"; then - scheck && runbg aplay ${self}/assets/sound/update.wav - else - scheck && runbg aplay ${self}/assets/sound/error.wav - fi + hooray() { scheck && runbg aplay ${self}/assets/sound/update.wav } + damn() { scheck && runbg aplay ${self}/assets/sound/error.wav } + case $1 in + "-h" ) if nh home switch -c ${host}Home "$FLAKEPATH"; then hooray; else damn; fi;; + "-s" ) if nh os switch -H ${host} "$FLAKEPATH"; then hooray; else damn; fi;; + * ) echo "Usage: rebuild -h for home config, rebuild -s for sys config";; + esac ''; } diff --git a/modules/sys/software/nixvim/plugins/coq.nix b/modules/sys/software/nixvim/plugins/coq.nix index cadede4..64b8a8f 100755 --- a/modules/sys/software/nixvim/plugins/coq.nix +++ b/modules/sys/software/nixvim/plugins/coq.nix @@ -3,7 +3,7 @@ plugins.coq-nvim = { enable = true; settings = { - auto_start = true; + auto_start = false; }; }; }; diff --git a/modules/sys/software/nixvim/plugins/default.nix b/modules/sys/software/nixvim/plugins/default.nix index 6f9aa16..21981f4 100755 --- a/modules/sys/software/nixvim/plugins/default.nix +++ b/modules/sys/software/nixvim/plugins/default.nix @@ -5,10 +5,10 @@ ./alpha.nix ./haskell.nix ./vim-matchup.nix - ./coq.nix + # ./coq.nix ./barbar.nix ./cmp.nix - ( import ./lsp.nix { inherit host self; }) + ./lsp.nix ./lualine.nix ./plugins.nix ./nvim-tree.nix diff --git a/modules/sys/software/nixvim/plugins/lsp.nix b/modules/sys/software/nixvim/plugins/lsp.nix index 5dd93b3..9c67d55 100755 --- a/modules/sys/software/nixvim/plugins/lsp.nix +++ b/modules/sys/software/nixvim/plugins/lsp.nix @@ -1,37 +1,82 @@ -{ host, ... }: -let - flakePath = builtins.getEnv "FLAKEPATH"; -in { programs.nixvim = { - plugins.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 { }"; - formatting.command = "nixfmt"; + plugins = { + cmp-snippy.enable = true; + cmp = { + enable = true; + settings = { + mapping = { + __raw = '' + cmp.mapping.preset.insert({ + [''] = cmp.mapping.close_docs(), + [''] = cmp.mapping.open_docs(), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = function(fallback) + if cmp.visible() then + cmp.confirm() + else + fallback() + end + end, -- Added a comma here + [''] = function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, -- Added a comma here + [''] = 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 { }"; + formatting.command = "nixfmt"; + }; options = { + # uses Xenon config because it has every option exposed to it 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; - sqls.enable = true; - hls = { - enable = true; - installGhc = true; + pyright.enable = true; + sqls.enable = true; + hls = { + enable = true; + installGhc = true; + }; }; }; };