From 08cf76855a2f7563c60a9480ee0c996e9c5e4c55 Mon Sep 17 00:00:00 2001 From: enggnr <129082112+enggnr@users.noreply.github.com> Date: Wed, 27 Dec 2023 16:08:13 +0530 Subject: [PATCH 1/2] Fix Vim CoC plugin installation setup --- home/.chezmoiexternal.toml.tmpl | 2 +- home/dot_config/shell/exports.sh.tmpl | 2 +- home/dot_config/vim/vimrc | 2 +- software.yml | 28 +++++++++++++-------------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/home/.chezmoiexternal.toml.tmpl b/home/.chezmoiexternal.toml.tmpl index e1eea114..1ef5b0e6 100644 --- a/home/.chezmoiexternal.toml.tmpl +++ b/home/.chezmoiexternal.toml.tmpl @@ -369,7 +369,7 @@ [".local/share/vim/plugged/coc.nvim"] type = "git-repo" url = "https://github.com/neoclide/coc.nvim.git" - {{ $gitArgs }} + clone.args = ["--branch", "release"] ### NVIM [".config/nvim"] diff --git a/home/dot_config/shell/exports.sh.tmpl b/home/dot_config/shell/exports.sh.tmpl index 418c190d..000b30b8 100644 --- a/home/dot_config/shell/exports.sh.tmpl +++ b/home/dot_config/shell/exports.sh.tmpl @@ -413,7 +413,7 @@ if [ -f "$HOME/.local/etc/ssl/curl/cacert.pem" ]; then export CERT_PATH="$HOME/.local/etc/ssl/curl/cacert.pem" export SSL_CERT_FILE="$CERT_PATH" export REQUESTS_CA_BUNDLE="$CERT_PATH" -elif command -v python3 > /dev/null; then +elif command -v python3 > /dev/null && pip3 list | grep certifi > /dev/null; then export CERT_PATH="$(python3 -m certifi)" || export CERT_PATH="$(python -m certifi)" export SSL_CERT_FILE="$CERT_PATH" export REQUESTS_CA_BUNDLE="$CERT_PATH" diff --git a/home/dot_config/vim/vimrc b/home/dot_config/vim/vimrc index 3d354226..c161548a 100644 --- a/home/dot_config/vim/vimrc +++ b/home/dot_config/vim/vimrc @@ -454,7 +454,7 @@ endif silent! call plug#begin('~/.local/share/vim/plugged') Plug '~/.local/share/vim/plugged/ale' -Plug '~/.local/share/vim/plugged/coc.nvim', {'branch': 'release', 'do': 'yarn install --frozen-lockfile'} +Plug '~/.local/share/vim/plugged/coc.nvim', {'branch': 'release'} Plug '~/.local/share/vim/plugged/copilot.vim' Plug '~/.local/share/vim/plugged/dockerfile.vim' Plug '~/.local/share/vim/plugged/editorconfig-vim' diff --git a/software.yml b/software.yml index 16c86203..9f1468e5 100644 --- a/software.yml +++ b/software.yml @@ -3119,7 +3119,7 @@ softwarePackages: # @brief Logs into DockerHub for Docker Desktop # @description # This script logs into DockerHub so that Docker Desktop is pre-authenticated. This - # functionality requires that the `DOCKERHUB_USER` be passed in as an environment variable (or + # functionality requires that the `DOCKERHUB_USER` be passed in as an environment variable (or # directly editted in the `~/.config/chezmoi/chezmoi.yaml` file) and that the `DOCKERHUB_TOKEN` # be passed in as a secret (either via the encrypted secret method or passed in as an environment # variable). @@ -5169,7 +5169,7 @@ softwarePackages: ### Populate appropriate token case "$OSTYPE" in solaris*) echo "TODO" ;; - darwin*) GITLAB_RUNNER_TOKEN="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "GITLAB_RUNNER_TOKEN_DARWIN")) }}{{ includeTemplate "secrets/GITLAB_RUNNER_TOKEN_DARWIN" | decrypt | trim }}{{ else }}{{ env "GITLAB_RUNNER_TOKEN_DARWIN" }}{{ end }}" ;; + darwin*) GITLAB_RUNNER_TOKEN="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "GITLAB_RUNNER_TOKEN_DARWIN")) }}{{ includeTemplate "secrets/GITLAB_RUNNER_TOKEN_DARWIN" | decrypt | trim }}{{ else }}{{ env "GITLAB_RUNNER_TOKEN_DARWIN" }}{{ end }}" ;; linux*) GITLAB_RUNNER_TOKEN="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "GITLAB_RUNNER_TOKEN_LINUX")) }}{{ includeTemplate "secrets/GITLAB_RUNNER_TOKEN_LINUX" | decrypt | trim }}{{ else }}{{ env "GITLAB_RUNNER_TOKEN_LINUX" }}{{ end }}" ;; bsd*) echo "TODO" ;; msys*) GITLAB_RUNNER_TOKEN="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "GITLAB_RUNNER_TOKEN_WINDOWS")) }}{{ includeTemplate "secrets/GITLAB_RUNNER_TOKEN_WINDOWS" | decrypt | trim }}{{ else }}{{ env "GITLAB_RUNNER_TOKEN_WINDOWS" }}{{ end }}" ;; @@ -5198,7 +5198,7 @@ softwarePackages: {{ end -}} {{ end }} fi - + ### Register VirtualBox based runners if VirtualBox is installed if [ $HAS_VIRTUALBOX -eq 1 ]; then logg info 'Registering GitLab Runner(s) that use VirtualBox executor' @@ -5272,12 +5272,12 @@ softwarePackages: if command -v gitomatic > /dev/null; then ### Copy bin to /usr/local/bin logg info "Copying $HOME/.local/bin/gitomatic-service to /usr/local/bin/gitomatic-service" && sudo cp -f "$HOME/.local/bin/gitomatic-service" /usr/local/bin/gitomatic-service - + ### Copy gitomatic to global directory if [ ! -f /usr/local/bin/gitomatic ]; then logg info 'Copying gitomatic executable to /usr/local/bin/gitomatic' && sudo cp -f "$(which gitomatic)" /usr/local/bin/gitomatic fi - + if [ -d /Applications ] && [ -d /System ]; then ### macOS logg info 'Copying gitomatic plist file to /Library/LaunchDaemons' && sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/gitomatic/com.github.muesli.gitomatic.plist" /Library/LaunchDaemons/com.github.muesli.gitomatic.plist @@ -7817,7 +7817,7 @@ softwarePackages: ### netdata-claim.sh must be run as netdata user sudo -H -u netdata bash -c 'export NETDATA_ROOM="{{- if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NETDATA_ROOM")) -}}{{- includeTemplate "secrets/NETDATA_ROOM" | decrypt | trim -}}{{- else -}}{{- env "NETDATA_ROOM" -}}{{- end -}}" && export NETDATA_TOKEN="{{- if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NETDATA_TOKEN")) -}}{{- includeTemplate "secrets/NETDATA_TOKEN" | decrypt | trim -}}{{- else -}}{{- env "NETDATA_TOKEN" -}}{{- end -}}" && yes | netdata-claim.sh -token="$NETDATA_TOKEN" -rooms="$NETDATA_ROOM" -url="https://app.netdata.cloud"' - + ### Kernel optimizations # These are mentioned while installing via the kickstart.sh script method. We are using Homebrew for the installation though. # Assuming these optimizations do not cause any harm. @@ -7849,7 +7849,7 @@ softwarePackages: logg error 'No etc location found for netdata' && exit 1 fi logg info "Copying ${XDG_CONFIG_HOME:-$HOME/.config}/netdata/health.d/ to $NETDATA_ETC" && sudo cp -rf "${XDG_CONFIG_HOME:-$HOME/.config}/netdata/health.d/" "$NETDATA_ETC" - + if command -v gsed > /dev/null; then SED_UTIL="gsed" else @@ -7859,7 +7859,7 @@ softwarePackages: ### Blocky logg info "Adding Blocky metrics collection to $NETDATA_ETC/go.d/prometheus.conf" sudo "$SED_UTIL" -i "/jobs:/a\ - name: blocky_local \n url: 'http://127.0.0.1:4000/metrics'" "$NETDATA_ETC/go.d/prometheus.conf" - + ### SFTPGo logg info "Adding SFTPGo metrics collection to $NETDATA_ETC/go.d/prometheus.conf" sudo "$SED_UTIL" -i "/jobs:/a\ - name: sftpgo_local \n url: 'http://127.0.0.1:57500/metrics'" "$NETDATA_ETC/go.d/prometheus.conf" @@ -10798,7 +10798,7 @@ softwarePackages: _home: https://github.com/skeeto/endlessh _name: Endlessh _service: endlessh - _post: | + _post: | #!/usr/bin/env bash # @file Endlessh Configuration # @brief Applies the Endlessh configuration and starts the service on Linux systems @@ -12018,7 +12018,7 @@ softwarePackages: # ## Links # # * [Privoxy configuration](https://github.com/megabyte-labs/install.doctor/tree/master/home/dot_config/privoxy/config) - + ### Define the Privoxy configuration location based on whether system is macOS or Linux if [ -d /Applications ] && [ -d /System ]; then ### macOS @@ -12044,7 +12044,7 @@ softwarePackages: sudo add-usergroup "$USER" privoxy fi sudo chown privoxy:privoxy "$PRIVOXY_CONFIG" 2> /dev/null || sudo chown privoxy:$(id -g -n) "$PRIVOXY_CONFIG" - + ### Restart Privoxy after configuration is applied if [ -d /Applications ] && [ -d /System ]; then ### macOS @@ -12384,7 +12384,7 @@ softwarePackages: _post: | #!/usr/bin/env bash echo "Installing VIM plugins" && vim +'PlugInstall --sync' +qall - echo "Updating VIM coc extensions" && vim +CocUpdateSync +qall + echo "Updating VIM coc extensions" && cd "$HOME/.config/coc/extensions" && echo '{"dependencies":{}}'> package.json && npm install '@yaegassy/coc-ansible' '@yaegassy/coc-nginx' 'coc-angular' 'coc-blade' 'coc-calc' 'coc-clangd' 'coc-copilot' 'coc-css' 'coc-cssmodules' 'coc-deno' 'coc-diagnostic' 'coc-docker' 'coc-emmet' 'coc-eslint' 'coc-explorer' 'coc-flutter' 'coc-fzf-preview' 'coc-git' 'coc-go' 'coc-highlight' 'coc-html-css-support' 'coc-html' 'coc-htmlhint' 'coc-java' 'coc-jedi' 'coc-json' 'coc-ltex' 'coc-lua' 'coc-markdown-preview-enhanced' 'coc-markdownlint' 'coc-markmap' 'coc-phpls' 'coc-powershell' 'coc-prettier' 'coc-prisma' 'coc-pyright' 'coc-rls' 'coc-rust-analyzer' 'coc-sh' 'coc-solargraph' 'coc-solidity' 'coc-spell-checker' 'coc-stylelint' 'coc-sql' 'coc-sqlfluff' 'coc-svelte' 'coc-svg' 'coc-swagger' 'coc-symbol-line' 'coc-tailwindcss' 'coc-toml' 'coc-tsserver' 'coc-xml' 'coc-yaml' 'coc-yank' --global-style --ignore-scripts --no-bin-links --no-package-lock --only=prod ansible: professormanhattan.vim apt: vim brew: vim @@ -13221,7 +13221,7 @@ softwarePackages: ### Python if command -v python3 > /dev/null; then ### Ensure Certifi package is available globally - if ! pip3 list certifi | grep certifi > /dev/null; then + if ! pip3 list | grep certifi > /dev/null; then if command -v brew > /dev/null; then logg info 'Ensuring Python certifi is installed via Homebrew' brew install --quiet python-certifi @@ -13583,7 +13583,7 @@ softwarePackages: # ## Links # # * [`fail2ban` configuration folder](https://github.com/megabyte-labs/install.doctor/tree/master/home/private_dot_ssh/fail2ban) - + ### Notify of script start logg info 'Configuring fail2ban' From 8c52de4a40c86927e21cf7051fd0eb436c857535 Mon Sep 17 00:00:00 2001 From: enggnr <129082112+enggnr@users.noreply.github.com> Date: Wed, 27 Dec 2023 20:54:57 +0530 Subject: [PATCH 2/2] Fix neovim Coc integration --- home/dot_config/coc/coc-settings.json | 67 ++++++++++++++------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/home/dot_config/coc/coc-settings.json b/home/dot_config/coc/coc-settings.json index 9491d657..28131b64 100644 --- a/home/dot_config/coc/coc-settings.json +++ b/home/dot_config/coc/coc-settings.json @@ -1,37 +1,38 @@ { "sh.enable": true, - "dockerfile": { - "command": "docker-langserver", - "filetypes": [ - "Dockerfile" - ], - "args": [ - "--stdio" - ] - }, - "sql": { - "module": "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lib/node_modules/sql-language-server/npm_bin/cli.js", - "args": [ - "up", - "--method", - "node-ipc" - ], - "filetypes": [ - "sql", - "mysql" - ] - }, - "terraform": { - "command": "terraform-ls", - "args": [ - "serve" - ], - "filetypes": [ - "terraform", - "tf" - ], - "initializationOptions": {}, - "settings": {} + "languageserver": { + "dockerfile": { + "command": "docker-langserver", + "filetypes": [ + "Dockerfile" + ], + "args": [ + "--stdio" + ] + }, + "sql": { + "module": "sql-language-server", + "args": [ + "up", + "--method", + "node-ipc" + ], + "filetypes": [ + "sql", + "mysql" + ] + }, + "terraform": { + "command": "terraform-ls", + "args": [ + "serve" + ], + "filetypes": [ + "terraform", + "tf" + ], + "initializationOptions": {}, + "settings": {} + } } } -} \ No newline at end of file