diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2023-02-22 21:26:47 +0100 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2023-02-22 21:26:47 +0100 |
| commit | 64f0954352342b32a1f128658c9ac4aba763d2c2 (patch) | |
| tree | 5a9e0a35e816184bb6dd15fa2dfd80a30370d761 | |
| parent | cd03ccb0e70aabc010652951cef02046cb08dabd (diff) | |
add codeium and refactor some things
| -rw-r--r-- | home.nix | 94 | ||||
| -rw-r--r-- | home/codeium.nix | 59 | ||||
| -rw-r--r-- | home/neovim.nix | 87 | ||||
| -rw-r--r-- | home/st.nix | 31 | ||||
| -rw-r--r-- | overlays/vimPlugins.nix | 6 |
5 files changed, 183 insertions, 94 deletions
@@ -5,6 +5,12 @@ home-manager, ... }: { + imports = [ + ./home/codeium.nix + ./home/neovim.nix + ./home/st.nix + ]; + home.username = "mike"; home.homeDirectory = "/home/mike"; home.stateVersion = "22.05"; @@ -39,12 +45,10 @@ swaylock swayidle - wl-clipboard + xclip mako wofi waybar - - (import ./home/st.nix {inherit pkgs;}) ] ++ (import ./shell-scripts.nix {inherit pkgs config;}); @@ -77,13 +81,13 @@ }; programs.gpg = { - enable = true; + enable = true; }; services.gpg-agent = { - enable = true; + enable = true; }; programs.password-store = { - enable = true; + enable = true; }; xsession = { @@ -114,82 +118,4 @@ }; }; }; - - home.activation = { - # links neovim repo to xdg config home - neovim-symlink = home-manager.lib.hm.dag.entryAfter ["writeBoundary"] '' - NEOVIM_CONFIG="${config.home.homeDirectory}/neovim" - XDG_CONFIG_HOME_NVIM="${config.xdg.configHome}/nvim" - if [ -L $XDG_CONFIG_HOME_NVIM ] && [ -e $XDG_CONFIG_HOME_NVIM ]; then - $DRY_RUN_CMD echo "neovim linked" - else - $DRY_RUN_CMD ln -s $NEOVIM_CONFIG $XDG_CONFIG_HOME_NVIM - fi - ''; - # fixes hotpot cannot be found error after updates - clearHotpotCache = home-manager.lib.hm.dag.entryAfter ["writeBoundary"] '' - HOTPOT_CACHE="${config.xdg.cacheHome}/nvim/hotpot" - if [[ -d "$HOTPOT_CACHE" ]]; then - $DRY_RUN_CMD rm -rf "$VERBOSE_ARG" "$HOTPOT_CACHE" - fi - ''; - }; - - programs.neovim = { - enable = true; - package = pkgs.neovim-unwrapped; - viAlias = true; - vimAlias = true; - extraPackages = with pkgs; [ - bashInteractive - fennel - sumneko-lua-language-server - pyright - gopls - yaml-language-server - alejandra - statix - fnlfmt - ]; - plugins = with pkgs.vimPlugins; [ - # highlighting - nvim-treesitter.withAllGrammars - nvim-ts-rainbow - playground - gruvbox-material - vim-just - - # external - vim-dirvish - vim-fugitive - vim-oscyank - - # Coding - nvim-lspconfig - nvim-dap - nvim-dap-ui - luasnip - trouble-nvim - null-ls-nvim - plenary-nvim - nlua-nvim - lsp_signature-nvim - vim-test - vim-rest-console - - # cmp - nvim-cmp - cmp-nvim-lsp - cmp-buffer - cmp-path - cmp_luasnip - - # trying out lisp - conjure - vim-racket - nvim-parinfer - hotpot-nvim - cmp-conjure - ]; - }; } diff --git a/home/codeium.nix b/home/codeium.nix new file mode 100644 index 0000000..f29f389 --- /dev/null +++ b/home/codeium.nix @@ -0,0 +1,59 @@ +{ + flake, + config, + pkgs, + home-manager, + ... +}: let + codeium = with pkgs; stdenv.mkDerivation rec { + pname = "codeium"; + version = "1.1.39"; + + ls-sha = "c8fda9657259bb7f3d432c1b558db921db4257aa"; + + src = fetchurl { + url = "https://github.com/Exafunction/codeium/releases/download/language-server-v${version}/language_server_linux_x64.gz"; + sha256 = "sha256-LA1VVW4X30a8UD9aDUCTmBKVXM7G0WE7dSsZ73TaaVo="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + ]; + + sourceRoot = "."; + + unpackPhase = '' + cp $src language_server_linux_x64.gz + gzip -d language_server_linux_x64.gz + ''; + + installPhase = '' + install -m755 -D language_server_linux_x64 $out + ''; + + preFixup = '' + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + $out + ''; + + meta = with lib; { + homepage = "https://www.codeium.com/"; + description = "Codeium language server"; + platforms = platforms.linux; + }; + }; +in { + home.activation = { + # links codeium into place + codium-symlink = home-manager.lib.hm.dag.entryAfter ["writeBoundary"] '' + CODEIUM_TARGET="${config.home.homeDirectory}/.codeium/bin/c8fda9657259bb7f3d432c1b558db921db4257aa" + if [ -L $CODEIUM_TARGET ] && [ -e $CODEIUM_TARGET ]; then + $DRY_RUN_CMD echo "codeium linked" + else + mkdir -p $CODEIUM_TARGET + $DRY_RUN_CMD ln -sf ${codeium} "$CODEIUM_TARGET/language_server_linux_x64" + fi + ''; + }; +} diff --git a/home/neovim.nix b/home/neovim.nix new file mode 100644 index 0000000..c4d8ba5 --- /dev/null +++ b/home/neovim.nix @@ -0,0 +1,87 @@ +{ + flake, + config, + pkgs, + home-manager, + ... +}: { + home.activation = { + # links neovim repo to xdg config home + neovim-symlink = home-manager.lib.hm.dag.entryAfter ["writeBoundary"] '' + NEOVIM_CONFIG="${config.home.homeDirectory}/neovim" + XDG_CONFIG_HOME_NVIM="${config.xdg.configHome}/nvim" + if [ -L $XDG_CONFIG_HOME_NVIM ] && [ -e $XDG_CONFIG_HOME_NVIM ]; then + $DRY_RUN_CMD echo "neovim linked" + else + $DRY_RUN_CMD ln -s $NEOVIM_CONFIG $XDG_CONFIG_HOME_NVIM + fi + ''; + # fixes hotpot cannot be found error after updates + clearHotpotCache = home-manager.lib.hm.dag.entryAfter ["writeBoundary"] '' + HOTPOT_CACHE="${config.xdg.cacheHome}/nvim/hotpot" + if [[ -d "$HOTPOT_CACHE" ]]; then + $DRY_RUN_CMD rm -rf "$VERBOSE_ARG" "$HOTPOT_CACHE" + fi + ''; + }; + + programs.neovim = { + enable = true; + package = pkgs.neovim-unwrapped; + viAlias = true; + vimAlias = true; + extraPackages = with pkgs; [ + bashInteractive + fennel + sumneko-lua-language-server + pyright + gopls + yaml-language-server + alejandra + statix + fnlfmt + ]; + plugins = with pkgs.vimPlugins; [ + # highlighting + nvim-treesitter.withAllGrammars + nvim-ts-rainbow + playground + gruvbox-material + vim-just + lsp_lines-nvim + + # external + vim-dirvish + vim-fugitive + vim-oscyank + + # Coding + codeium-vim + nvim-lspconfig + nvim-dap + nvim-dap-ui + luasnip + trouble-nvim + null-ls-nvim + plenary-nvim + nlua-nvim + lsp_signature-nvim + vim-test + vim-rest-console + + # cmp + nvim-cmp + cmp-nvim-lsp + cmp-buffer + cmp-path + cmp_luasnip + + # trying out lisp + conjure + vim-racket + nvim-parinfer + hotpot-nvim + cmp-conjure + ]; + }; +} diff --git a/home/st.nix b/home/st.nix index 8d2a9a9..1d3a504 100644 --- a/home/st.nix +++ b/home/st.nix @@ -1,10 +1,21 @@ -{pkgs, ...}: -with pkgs; (st.overrideAttrs (oldAttrs: rec { - src = fetchFromGitHub { - owner = "LukeSmithxyz"; - repo = "st"; - rev = "36d225d71d448bfe307075580f0d8ef81eeb5a87"; - sha256 = "sha256-u8E8/aqbL3T4Sz0olazg7VYxq30haRdSB1SRy7MiZiA="; - }; - buildInputs = oldAttrs.buildInputs ++ [harfbuzz]; -})) +{ + flake, + config, + pkgs, + home-manager, + ... +}: let + st-luke-smith = with pkgs; (st.overrideAttrs (oldAttrs: rec { + src = fetchFromGitHub { + owner = "LukeSmithxyz"; + repo = "st"; + rev = "36d225d71d448bfe307075580f0d8ef81eeb5a87"; + sha256 = "sha256-u8E8/aqbL3T4Sz0olazg7VYxq30haRdSB1SRy7MiZiA="; + }; + buildInputs = oldAttrs.buildInputs ++ [harfbuzz]; + })); +in { + home.packages = [ + st-luke-smith + ]; +} diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index 0e485cb..7933c5a 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -43,5 +43,11 @@ git = "diepm/vim-rest-console"; rev = "7b407f47185468d1b57a8bd71cdd66c9a99359b2"; }; + codeium-vim = getVimPlugin { + name = "codeium-vim"; + git = "Exafunction/codeium.vim"; + rev = "be2fa21f4f63850382a0cefeaa9f766b977c9f0c"; + ref = "refs/heads/main"; + }; }; }) |
