From 1bab83301127c63b1bbe1b808b02d8337bdd7c18 Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Sun, 9 Jul 2023 08:11:02 +0000 Subject: [PATCH] Latest --- home/.chezmoi.yaml.tmpl | 8 ++--- .../run_onchange_after_14-warp.sh.tmpl | 6 ++-- .../dot_config/gitomatic/gitomatic.plist.tmpl | 6 ++-- .../gitomatic/gitomatic.service.tmpl | 3 +- .../bin/executable_gitomatic-service.tmpl | 31 +++++++++++++++++++ .../bin/executable_gitomatic_service.tmpl | 17 ---------- software.yml | 20 ++++++------ 7 files changed, 52 insertions(+), 39 deletions(-) create mode 100644 home/dot_local/bin/executable_gitomatic-service.tmpl delete mode 100644 home/dot_local/bin/executable_gitomatic_service.tmpl diff --git a/home/.chezmoi.yaml.tmpl b/home/.chezmoi.yaml.tmpl index affa938c..0a57acd4 100644 --- a/home/.chezmoi.yaml.tmpl +++ b/home/.chezmoi.yaml.tmpl @@ -194,12 +194,8 @@ data: github: username: "{{ $githubUsername }}" gitomatic: - - git: https://github.com/megabyte-labs/install.doctor - path: $HOME/sources/install.doctor - - git: https://github.com/megabyte-labs/install.doctor-docs - path: $HOME/sources/install.doctor-docs - - git: https://github.com/megabyte-labs/install.doctor-site - path: $HOME/sources/install.doctor-site + - git: "{{ default "git@github.com:megabyte-labs/install.doctor.git" (env "START_REPO") }}" + path: /usr/local/src/install.doctor gmail: username: "{{ $gmailAddress }}" gpg: diff --git a/home/.chezmoiscripts/universal/run_onchange_after_14-warp.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_14-warp.sh.tmpl index e7efca05..467bc070 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_14-warp.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_14-warp.sh.tmpl @@ -172,9 +172,9 @@ if command -v warp-cli > /dev/null; then ### Google Cloud SDK if command -v gcloud > /dev/null; then logg info "Configuring gcloud to use "${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.pem" and "${XDG_DATA_HOME:-$HOME/.local/share}/curl/cacert.pem"" - mkdir -p "${XDG_DATA_HOME:$HOME/.local/share}/gcloud" - cat cacert.pem "${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.pem" > "${XDG_DATA_HOME:$HOME/.local/share}/gcloud/ca.pem" - gcloud config set core/custom_ca_certs_file "${XDG_DATA_HOME:$HOME/.local/share}/gcloud/ca.pem" + mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/gcloud" + cat cacert.pem "${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.pem" > "${XDG_DATA_HOME:-$HOME/.local/share}/gcloud/ca.pem" + gcloud config set core/custom_ca_certs_file "${XDG_DATA_HOME:-$HOME/.local/share}/gcloud/ca.pem" fi ### Google Drive for desktop (macOS) diff --git a/home/dot_config/gitomatic/gitomatic.plist.tmpl b/home/dot_config/gitomatic/gitomatic.plist.tmpl index fc9ed4df..294b8ab4 100644 --- a/home/dot_config/gitomatic/gitomatic.plist.tmpl +++ b/home/dot_config/gitomatic/gitomatic.plist.tmpl @@ -4,10 +4,10 @@ Label - com.gitomatic + gitomatic Program - {{ .chezmoi.homeDir }}/.local/bin/gitomatic_service + {{ .chezmoi.homeDir }}/.local/bin/gitomatic-service RunAtLoad -{{ end }} +{{- end }} diff --git a/home/dot_config/gitomatic/gitomatic.service.tmpl b/home/dot_config/gitomatic/gitomatic.service.tmpl index 609bfa23..127f19b4 100644 --- a/home/dot_config/gitomatic/gitomatic.service.tmpl +++ b/home/dot_config/gitomatic/gitomatic.service.tmpl @@ -4,7 +4,8 @@ Description=Service to watch git repositories [Service] Type=simple -ExecStart={{ .chezmoi.homeDir }}/.local/bin/gitomatic_service +User={{ .user.username }} +ExecStart={{ .chezmoi.homeDir }}/.local/bin/gitomatic-service Restart=on-failure [Install] diff --git a/home/dot_local/bin/executable_gitomatic-service.tmpl b/home/dot_local/bin/executable_gitomatic-service.tmpl new file mode 100644 index 00000000..08a13d1d --- /dev/null +++ b/home/dot_local/bin/executable_gitomatic-service.tmpl @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# @file .local/bin/gitomatic-service +# @brief Helper script to run gitomatic to monitor git repositories +# @description +# This script is executed by gitomatic systemd service. `gitomatic` does not support monitoring multiple +# repositories in a single process. This script starts as many gitomatic processes as there are repositories. +# +# This feature allows you to specify git repositories and corresponding paths to keep in-sync, using both git +# push and pull. +# +# ## Links +# +# [Systemd Unit file](https://github.com/megabyte-labs/install.doctor/blob/master/home/dot_config/gitomatic/gitomatic.service.tmpl) + +{{ includeTemplate "universal/profile" }} +{{ includeTemplate "universal/logg" }} + +if command -v gitomatic > /dev/null; then + for IM in $(yq eval -o=j "${XDG_CONFIG_HOME:-$HOME/.config}/chezmoi/chezmoi.yaml" | jq -cr '.data.user.gitomatic[]'); do + GIT="$(echo $IM | jq -r '.git' -)" + GIT_PATH="$(echo $IM | jq -r '.path' -)" + if [ ! -d "$GIT_PATH" ]; then + git clone "$GIT" "$GIT_PATH" + fi + cd "$GIT_PATH" + gitomatic -email "$(git config user.email)" "$GIT_PATH" & + done +else + logg error '`gitomatic` should be installed!' && exit 1 +fi diff --git a/home/dot_local/bin/executable_gitomatic_service.tmpl b/home/dot_local/bin/executable_gitomatic_service.tmpl deleted file mode 100644 index c1574d2e..00000000 --- a/home/dot_local/bin/executable_gitomatic_service.tmpl +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# @file .local/bin/gitomatic_service -# @brief Helper script to run gitomatic to monitor git repositories -# @description -# This script is executed by gitomatic systemd service. `gitomatic` does not support monitoring multiple -# repositories in a single process. This script starts as many gitomatic processes as there are repositories. -# -# ## Links -# -# [Systemd Unit file](https://github.com/megabyte-labs/install.doctor/blob/master/home/dot_config/gitomatic/gitomatic.service.tmpl) - -{{ includeTemplate "universal/logg" }} - -{{ range .data.user.gitomatic }} -gitomatic -author {{ $.data.user.name }} -email {{ $.data.user.email }} -privkey {{ $.chezmoi.homeDir }}/.ssh/id_rsa {{ .path }} & -{{ end -}} diff --git a/software.yml b/software.yml index 2b9d1479..b88076fa 100644 --- a/software.yml +++ b/software.yml @@ -6191,7 +6191,7 @@ softwarePackages: sudo chmod 644 /etc/udev/rules.d/49-onlykey.rules sudo udevadm control --reload-rules sudo udevadm trigger - _when:script:darwin: test -d "/Applications/OnlyKey App.app" + _when:script:darwin: '! test -d "/Applications/OnlyKey App.app"' ansible:darwin: professormanhattan.onlykey script:darwin: cd /tmp && curl -sSL https://github.com/trustcrypto/OnlyKey-App/releases/download/v5.3.6/OnlyKey.App.5.3.6.dmg > OnlyKey.dmg && hdiutil attach "/tmp/OnlyKey.dmg" && sudo cp -R "/Volumes/OnlyKey App/OnlyKey App.app" /Applications && sudo hdiutil detach "/Volumes/OnlyKey App" && rm -f "/tmp/OnlyKey.dmg" choco: onlykey @@ -9932,7 +9932,7 @@ softwarePlugins: plugins: - deployer/deployer docker: - cmd: bash -c 'docker extension install {PLUGIN}' + cmd: bash -c 'if ! docker extension list | grep {PLUGIN} > /dev/null; then echo y | docker extension install {PLUGIN}; fi' plugins: - docker/disk-usage-extension - docker/logs-explorer-extension @@ -9949,12 +9949,12 @@ softwarePlugins: plugins: - docker.io/nginx/unit dotnet: - cmd: dotnet tool install -g {PLUGIN} + cmd: bash -c 'if dotnet tool list -g | grep {PLUGIN} > /dev/null; then dotnet tool install -g {PLUGIN}; fi' plugins: - - Microsoft.CST.AttackSurfaceAnalyzer.CLI + - microsoft.cst.attacksurfaceanalyzer.cli - dotnet-format gcloud: - cmd: bash -c 'gcloud components install {PLUGIN}' + cmd: bash -c 'if ! gcloud components list | grep 'Installed.*{PLUGIN}' > /dev/null; then gcloud components install {PLUGIN}; fi' plugins: - app-engine-go - cloud-datastore-emulator @@ -9970,7 +9970,7 @@ softwarePlugins: - terraform-tools update: gcloud components update gh: - cmd: bash -c 'if [ -n "$GITHUB_TOKEN" ] && ! gh extension list | grep {PLUGIN}; then gh extension install {PLUGIN}; fi' + cmd: bash -c 'if [ -n "$GITHUB_TOKEN" ] && ! gh extension list | grep {PLUGIN} > /dev/null; then gh extension install {PLUGIN}; fi' plugins: - abdfnx/gh-tran - dlvhdr/gh-dash @@ -10005,7 +10005,7 @@ softwarePlugins: - https://www.raycast.com/abielzulio/chatgpt - https://www.raycast.com/BalliAsghar/mailsy steampipe: - cmd: steampipe plugin install {PLUGIN} + cmd: bash -c 'if [ ! -f /tmp/steampipe-plugin-list ]; then steampipe plugin list > /tmp/steampipe-plugin-list; fi && if ! cat /tmp/steampipe-plugin-list | grep {PLUGIN} > /dev/null; then steampipe plugin install {PLUGIN}; fi' plugins: - algolia - aws @@ -10069,10 +10069,12 @@ softwarePlugins: - vagrant-google - vagrant-hostmanager - vagrant-libvirt + # Dependency issues # - vagrant-openstack-provider - - vagrant-openstack + # - vagrant-openstack - vagrant-parallels - - vagrant-proxmox + # Dependency issue + # - vagrant-proxmox - vagrant-share - vagrant-vbguest - vagrant-vmware-desktop