From 59c740113832ea9c725d1a06833da994fc8e8aab Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Mon, 17 Jul 2023 07:28:38 +0000 Subject: [PATCH] Latest --- docs/TODO.md | 5 +- home/.chezmoidata.yaml | 11 +++ home/.chezmoiexternal.toml.tmpl | 8 ++ .../run_before_01-system-homebrew.sh.tmpl | 84 +++++++++++++++---- .../run_onchange_after_01-auto-update.sh.tmpl | 20 +++++ .../run_onchange_after_50-rclone.sh.tmpl | 21 +++++ .../run_onchange_after_69-emsdk.sh.tmpl | 4 +- .../run_onchange_after_97-cloudflare.sh.tmpl | 7 ++ .../LaunchDaemons/rclone.user.plist.tmpl | 2 +- .../run_onchange_after_launch-daemons.sh.tmpl | 32 ------- home/dot_bashrc | 8 +- home/dot_config/fish/config.fish | 9 ++ home/dot_config/git/config.tmpl | 1 + home/dot_config/shell/exports.sh.tmpl | 5 ++ .../update-git-pull/directories/custom.txt | 0 .../update-git-pull/directories/default.txt | 0 .../update-hg-pull/directories/custom.txt | 0 .../update-hg-pull/directories/default.txt | 0 .../update/update-run-first/README.md | 10 +++ .../update/update-run-last/README.md | 3 + .../bin/executable_install-program-cache.tmpl | 5 ++ home/dot_zshrc | 22 +++-- scripts/provision.sh | 27 +++--- software.yml | 84 +++++++++++++++++-- 24 files changed, 283 insertions(+), 85 deletions(-) create mode 100644 home/.chezmoiscripts/universal/run_onchange_after_01-auto-update.sh.tmpl delete mode 100644 home/Library/LaunchDaemons/run_onchange_after_launch-daemons.sh.tmpl create mode 100644 home/dot_config/fish/config.fish create mode 100644 home/dot_config/update/update-git-pull/directories/custom.txt create mode 100644 home/dot_config/update/update-git-pull/directories/default.txt create mode 100644 home/dot_config/update/update-hg-pull/directories/custom.txt create mode 100644 home/dot_config/update/update-hg-pull/directories/default.txt create mode 100644 home/dot_config/update/update-run-first/README.md create mode 100644 home/dot_config/update/update-run-last/README.md create mode 100644 home/dot_local/bin/executable_install-program-cache.tmpl diff --git a/docs/TODO.md b/docs/TODO.md index dd79495e..cdd81976 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -5,7 +5,9 @@ xattr -d com.apple.quarantine rclone # TODOs This page outlines various projects and tasks that we are currently working on. Creating a GitHub issue for each of these items would be overkill. - +* [Title](https://www.ipfire.org/) +* `git-credential-manager configure` +* [Title](https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/wsl.md) * [Title](https://github.com/KnowledgeCanvas/knowledge) * Configure Navi to automatically download and use the best cheat repositories * Finish TS from 1400 stars @@ -76,6 +78,7 @@ The following links include software that need to be reviewed before including t The following items are Docker containers that we may want to include as default containers deployed in our system. +* [Title](https://github.com/sipt/shuttle) * https://github.com/erxes/erxes - CRM * https://github.com/pawelmalak/flame - Homepage * https://github.com/thelounge/thelounge - IRC diff --git a/home/.chezmoidata.yaml b/home/.chezmoidata.yaml index 574fc6bc..7bab7df1 100644 --- a/home/.chezmoidata.yaml +++ b/home/.chezmoidata.yaml @@ -325,10 +325,13 @@ softwareGroups: - axel - bin - bitly + - brew-gem + - brew-pkg - charm - cod - desed - difftastic + - dockutil - duti - emplace - emoj @@ -518,6 +521,8 @@ softwareGroups: Essentials: &Essentials - clamav - docker + - meta-package-manager + - openssl-osx-ca - rkhunter Essentials-Desktop: &Essentials-Desktop - autokey @@ -664,6 +669,7 @@ softwareGroups: - crunch - exiftool - ffmpeg + - gifsicle - imagemagick - jpegoptim - korkut @@ -675,6 +681,7 @@ softwareGroups: - vidmerger - wkhtmltopdf - youtube-dl + - yt-dlp Media-Desktop: &Media-Desktop - adobe-creative-cloud - audacity @@ -768,6 +775,7 @@ softwareGroups: - platformio - please - porter + - proxyman - rust - snapcraft - solidity @@ -791,6 +799,7 @@ softwareGroups: - cockpit - cups - lexicon + - squid Networking: &Networking - etcd - cloudflared @@ -1377,6 +1386,8 @@ softwareGroups: note: Unused Docker assistance package - pkg: catfs note: CatFS is reportedly in the alpha stage of development and we experienced issues when trying to use it. + - pkg: ccat + note: bat can be used instead and has more features - pkg: cerebro note: macOS system search more native way of providing similar features. Better alternatives are available. - pkg: chromium diff --git a/home/.chezmoiexternal.toml.tmpl b/home/.chezmoiexternal.toml.tmpl index 26b89b7c..bb80ad1a 100644 --- a/home/.chezmoiexternal.toml.tmpl +++ b/home/.chezmoiexternal.toml.tmpl @@ -31,6 +31,14 @@ type = "file" url = "https://curl.se/ca/cacert.pem" +### Update scripts +[".local/bin/update"] + type = "git-repo" + url = "https://github.com/UpdateCommand/update.git" + clone.args = ["--depth", "1"] + pull.args = ["--ff-only"] + refreshPeriod = "{{ $refreshPeriod }}" + ### Betelgeuse Theme [".local/src/betelgeuse"] type = "git-repo" diff --git a/home/.chezmoiscripts/universal/run_before_01-system-homebrew.sh.tmpl b/home/.chezmoiscripts/universal/run_before_01-system-homebrew.sh.tmpl index 88da0a13..8d315026 100644 --- a/home/.chezmoiscripts/universal/run_before_01-system-homebrew.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_before_01-system-homebrew.sh.tmpl @@ -28,13 +28,67 @@ if [ -d /Applications ] && [ -d /Library ] && [ -z "$NO_RESTART" ]; then logg info 'If system updates were downloaded / installed, a reboot might be required.' fi -### Install Xcode CLI tools on macOS -if [ -d /Applications ] && [ -d /Library ]; then - logg info 'Ensuring xcode-select is installed for developer tools' - xcode-select -p >/dev/null 2>&1 || sudo xcode-select --install +### Ensure dependencies are installed on Linux +if ! command -v curl > /dev/null || ! command -v git > /dev/null || ! command -v expect > /dev/null || ! command -v rsync > /dev/null; then + if command -v apt-get > /dev/null; then + # @description Ensure `build-essential`, `curl`, `expect`, `git`, `rsync`, `procps`, and `file` are installed on Debian / Ubuntu + sudo apt-get update + sudo apt-get install -y build-essential curl expect git rsync procps file + elif command -v dnf > /dev/null; then + # @description Ensure `curl`, `expect`, `git`, `rsync`, `procps-ng`, and `file` are installed on Fedora (as well as the Development Tools package) + sudo dnf groupinstall -y 'Development Tools' + sudo dnf install -y curl expect git rsync procps-ng file + elif command -v yum > /dev/null; then + # @description Ensure `curl`, `expect`, `git`, `rsync`, `procps-ng`, and `file` are installed on CentOS (as well as the Development Tools package) + sudo yum groupinstall -y 'Development Tools' + sudo yum install -y curl expect git rsync procps-ng file + elif command -v pacman > /dev/null; then + # @description Ensure `base-devel`, `curl`, `expect`, `git`, `rsync`, `procps-ng`, and `file` are installed on Archlinux + sudo pacman update + sudo pacman -Sy base-devel curl expect git rsync procps-ng file + elif command -v zypper > /dev/null; then + # @description Ensure `curl`, `expect`, `git`, `rsync`, `procps`, and `file` are installed on OpenSUSE (as well as the devel_basis pattern) + sudo zypper install -yt pattern devel_basis + sudo zypper install -y curl expect git rsync procps file + elif command -v apk > /dev/null; then + # @description Ensure `curl`, `expect`, `git`, `rsync`, `procps`, and `file` are installed on Alpine + apk add build-base curl expect git rsync procps file + elif [ -d /Applications ] && [ -d /Library ]; then + # @description Ensure CLI developer tools are available on macOS (via `xcode-select`) + sudo xcode-select -p >/dev/null 2>&1 || xcode-select --install + elif [[ "$OSTYPE" == 'cygwin' ]] || [[ "$OSTYPE" == 'msys' ]] || [[ "$OSTYPE" == 'win32' ]]; then + # @description Ensure `curl`, `expect`, `git`, and `rsync` are installed on Windows + choco install -y curl expect git rsync + fi fi -### Install Homebrew +### Ensure Linux Homebrew is loaded +loadLinuxbrew() { + if ! command -v brew > /dev/null; then + if [ -d "$HOME/.linuxbrew" ]; then + eval "$("$HOME/.linuxbrew/bin/brew" shellenv)" + elif [ -d "/home/linuxbrew/.linuxbrew" ]; then + eval "(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + fi + fi +} + +### Ensures Homebrew folders have proper owners / permissions +fixHomebrewPermissions() { + if command -v brew > /dev/null; then + logg info 'Applying proper permissions on Homebrew folders' + sudo chmod -R go-w "$(brew --prefix)/share" + BREW_DIRS="share/man share/doc share/zsh/site-functions etc/bash_completion.d" + for BREW_DIR in $BREW_DIRS; do + if [ -d "$(brew --prefix)/$BREW_DIR" ]; then + sudo chown -R "$(whoami)" "$(brew --prefix)/$BREW_DIR" + fi + done + brew update --force --quiet + fi +} + +### Installs Homebrew ensurePackageManagerHomebrew() { if ! command -v brew > /dev/null; then if command -v sudo > /dev/null && sudo -n true; then @@ -43,23 +97,19 @@ ensurePackageManagerHomebrew() { logg info 'Homebrew is not installed. Password may be required.' bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" || BREW_EXIT_CODE="$?" if [ -n "$BREW_EXIT_CODE" ]; then - if command -v brew > /dev/null; then - logg warn 'Homebrew was installed but part of the installation failed. Attempting to fix..' - BREW_DIRS="share/man share/doc share/zsh/site-functions etc/bash_completion.d" - for BREW_DIR in $BREW_DIRS; do - if [ -d "$(brew --prefix)/$BREW_DIR" ]; then - sudo chown -R "$(whoami)" "$(brew --prefix)/$BREW_DIR" - fi - done - brew update --force --quiet - fi + logg warn 'Homebrew was installed but part of the installation failed to complete successfully.' fi fi fi } -ensurePackageManagerHomebrew -# @description Enable auto-update service +### Logic +loadLinuxbrew +ensurePackageManagerHomebrew +loadLinuxbrew +fixHomebrewPermissions + +### Enable auto-update service if brew autoupdate status | grep 'Autoupdate is not configured.' > /dev/null; then logg info 'Enabling Homebrew auto-update service (every 24 hours)' brew autoupdate start --cleanup --greedy --upgrade diff --git a/home/.chezmoiscripts/universal/run_onchange_after_01-auto-update.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_01-auto-update.sh.tmpl new file mode 100644 index 00000000..0179491d --- /dev/null +++ b/home/.chezmoiscripts/universal/run_onchange_after_01-auto-update.sh.tmpl @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# @file Ensure Auto-Update +# @brief Configures macOS to automatically check for system updates +# @description +# This script adds a macOS LaunchDaemon for the root user that checks for updates and automatically +# applies them. It will run if the file is available at `$HOME/Library/LaunchDaemons/com.apple.automatedupdates.plist`. + +{{ includeTemplate "universal/profile" }} +{{ includeTemplate "universal/logg" }} + +### Enable automated updates on macOS +if [ -d /Applications ] && [ -d /System ]; then + if [ -f "$HOME/Library/LaunchDaemons/com.apple.automatedupdates.plist" ] && [ ! -f "/Library/LaunchDaemons/com.apple.automatedupdates.plist" ]; then + logg info 'Configuring macOS to automatically apply system updates' + sudo mkdir -p /Library/LaunchDaemons + sudo cp -f "$HOME/Library/LaunchDaemons/com.apple.automatedupdates.plist" "/Library/LaunchDaemons/com.apple.automatedupdates.plist" + logg info 'Loading `/Library/LaunchDaemons/com.apple.automatedupdates.plist`' + sudo launchctl load "/Library/LaunchDaemons/com.apple.automatedupdates.plist" && logg success 'launchctl load successful' + fi +fi diff --git a/home/.chezmoiscripts/universal/run_onchange_after_50-rclone.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_50-rclone.sh.tmpl index 5a697281..6c22f47d 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_50-rclone.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_50-rclone.sh.tmpl @@ -104,6 +104,27 @@ if command -v rclone > /dev/null; then sudo systemctl enable "s3-${USER}" sudo systemctl restart "s3-${USER}" fi + + if [ -d /Applications ] && [ -d /System ]; then + ### Enable Rclone mounts + logg info 'Ensuring Rclone mount-on-reboot definitions are in place' + if [ -f "$HOME/Library/LaunchDaemons/rclone.private.plist" ] && [ ! -f "/Library/LaunchDaemons/rclone.private.plist" ]; then + logg info 'Adding /Volumes/Private as S3 bucket mount, enabled at boot' + sudo mkdir -p /Library/LaunchDaemons + sudo cp -f "$HOME/Library/LaunchDaemons/rclone.private.plist" '/Library/LaunchDaemons/rclone.private.plist' + sudo launchctl load '/Library/LaunchDaemons/rclone.private.plist' && logg success 'launchctl load successful' + fi + if [ -f "$HOME/Library/LaunchDaemons/rclone.public.plist" ] && [ ! -f "/Library/LaunchDaemons/rclone.public.plist" ]; then + logg info 'Adding /Volumes/Public as S3 bucket mount, enabled at boot' + sudo mkdir -p /Library/LaunchDaemons + sudo cp -f "$HOME/Library/LaunchDaemons/rclone.public.plist" '/Library/LaunchDaemons/rclone.public.plist' + sudo launchctl load '/Library/LaunchDaemons/rclone.public.plist' && logg success 'launchctl load successful' + fi + if [ -f "$HOME/Library/LaunchDaemons/rclone.user.plist" ] && ! launchctl list | grep 'rclone.user' > /dev/null; then + logg info 'Adding ~/Public as S3 bucket mount, enabled at boot' + launchctl load "$HOME/Library/LaunchDaemons/rclone.user.plist" && logg success 'user launchctl load successful' + fi + fi else logg info '`rclone` is not available' fi diff --git a/home/.chezmoiscripts/universal/run_onchange_after_69-emsdk.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_69-emsdk.sh.tmpl index 25aea208..958fa273 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_69-emsdk.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_69-emsdk.sh.tmpl @@ -12,7 +12,7 @@ if [ -d "${XDG_DATA_HOME:-$HOME/.local/share}/emsdk" ]; then cd "${XDG_DATA_HOME:-$HOME/.local/share}/emsdk" logg info 'Pulling latest changes for Emscripten source code' git pull && logg success 'Successfully pulled latest Emscripten source code' - ./emsdk install latest && logg success 'Installed latest Emscripten target' - ./emsdk activate latest && logg success 'Activated latest Emscripten target' + ./emsdk install latest > /dev/null && logg success 'Installed latest Emscripten target' + ./emsdk activate latest > /dev/null && logg success 'Activated latest Emscripten target' logg info 'Profile source inclusions are already implemented in Bash / ZSH profile' fi diff --git a/home/.chezmoiscripts/universal/run_onchange_after_97-cloudflare.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_97-cloudflare.sh.tmpl index c79e0aaa..f5f7f4f9 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_97-cloudflare.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_97-cloudflare.sh.tmpl @@ -200,6 +200,13 @@ if command -v warp-cli > /dev/null; then if [ -d /System ] && [ -d /Applications ]; then sudo cp -f "$HOME/Library/Managed Preferences/com.cloudflare.warp.plist" '/Library/Managed Preferences/com.cloudflare.warp.plist' sudo plutil -convert binary1 '/Library/Managed Preferences/com.cloudflare.warp.plist' + + ### Enable CloudFlare WARP credentials auto-populate (since file is deleted when not managed with MDM) + if [ -f "$HOME/Library/LaunchDaemons/com.cloudflare.warp.plist" ] && [ ! -f "/Library/LaunchDaemons/com.cloudflare.warp.plist" ]; then + sudo mkdir -p /Library/LaunchDaemons + sudo cp -f "$HOME/Library/LaunchDaemons/com.cloudflare.warp.plist" '/Library/LaunchDaemons/com.cloudflare.warp.plist' + sudo launchctl load "/Library/LaunchDaemons/com.cloudflare.warp.plist" + fi elif [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/warp/mdm.xml" ]; then sudo mkdir -p /var/lib/cloudflare-warp sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/warp/mdm.xml" /var/lib/cloudflare-warp/mdm.xml diff --git a/home/Library/LaunchDaemons/rclone.user.plist.tmpl b/home/Library/LaunchDaemons/rclone.user.plist.tmpl index 9f148ed8..130751ad 100644 --- a/home/Library/LaunchDaemons/rclone.user.plist.tmpl +++ b/home/Library/LaunchDaemons/rclone.user.plist.tmpl @@ -5,7 +5,7 @@ KeepAlive Label - rclone.public + rclone.user ProgramArguments /usr/local/bin/rclone-mount diff --git a/home/Library/LaunchDaemons/run_onchange_after_launch-daemons.sh.tmpl b/home/Library/LaunchDaemons/run_onchange_after_launch-daemons.sh.tmpl deleted file mode 100644 index af821b58..00000000 --- a/home/Library/LaunchDaemons/run_onchange_after_launch-daemons.sh.tmpl +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -if [ -d /Applications ] && [ -d /System ]; then - ### Enable automated updates on macOS - if [ -f "$HOME/Library/LaunchDaemons/com.apple.automatedupdates.plist" ] && [ ! -f "/Library/LaunchDaemons/com.apple.automatedupdates.plist" ]; then - sudo mkdir -p /Library/LaunchDaemons - sudo cp -f "$HOME/Library/LaunchDaemons/com.apple.automatedupdates.plist" "/Library/LaunchDaemons/com.apple.automatedupdates.plist" - sudo launchctl load "/Library/LaunchDaemons/com.apple.automatedupdates.plist" - fi - - ### Enable CloudFlare WARP credentials auto-populate (since file is deleted when not managed with MDM) - if [ -f "$HOME/Library/LaunchDaemons/com.cloudflare.warp.plist" ] && [ ! -f "/Library/LaunchDaemons/com.cloudflare.warp.plist" ]; then - sudo mkdir -p /Library/LaunchDaemons - sudo cp -f "$HOME/Library/LaunchDaemons/com.cloudflare.warp.plist" '/Library/LaunchDaemons/com.cloudflare.warp.plist' - sudo launchctl load "/Library/LaunchDaemons/com.cloudflare.warp.plist" - fi - - ### Enable Rclone mounts - if [ -f "$HOME/Library/LaunchDaemons/rclone.private.plist" ] && [ ! -f "/Library/LaunchDaemons/rclone.private.plist" ]; then - sudo mkdir -p /Library/LaunchDaemons - sudo cp -f "$HOME/Library/LaunchDaemons/rclone.private.plist" '/Library/LaunchDaemons/rclone.private.plist' - sudo launchctl load '/Library/LaunchDaemons/rclone.private.plist' - fi - if [ -f "$HOME/Library/LaunchDaemons/rclone.public.plist" ] && [ ! -f "/Library/LaunchDaemons/rclone.public.plist" ]; then - sudo mkdir -p /Library/LaunchDaemons - sudo cp -f "$HOME/Library/LaunchDaemons/rclone.public.plist" '/Library/LaunchDaemons/rclone.public.plist' - sudo launchctl load '/Library/LaunchDaemons/rclone.public.plist' - fi - if [ -f "$HOME/Library/LaunchDaemons/rclone.user.plist" ]; then - launchctl load "$HOME/Library/LaunchDaemons/rclone.user.plist" - fi -fi diff --git a/home/dot_bashrc b/home/dot_bashrc index e2ee3313..fa4ed84e 100644 --- a/home/dot_bashrc +++ b/home/dot_bashrc @@ -69,12 +69,8 @@ if [ "$BASH_SUPPORT" = 'true' ]; then fi fi - ### Bash Completion - if [ -f "/usr/local/etc/profile.d/bash_completion.sh" ]; then - . "/usr/local/etc/profile.d/bash_completion.sh" - fi - ### Bash Completion (Homebrew) + autoload -U +X bashcompinit && bashcompinit if command -v brew > /dev/null; then if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]; then . "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" @@ -142,6 +138,6 @@ if [ "$BASH_SUPPORT" = 'true' ]; then ### zoxide if command -v zoxide > /dev/null; then - eval "$(zoxide init --cmd cd bash)" + eval "$(zoxide init --cmd cd bash)" > /dev/null fi fi diff --git a/home/dot_config/fish/config.fish b/home/dot_config/fish/config.fish new file mode 100644 index 00000000..73bbeda0 --- /dev/null +++ b/home/dot_config/fish/config.fish @@ -0,0 +1,9 @@ +### Homebrew Completions +# Source: https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish +if test -d (brew --prefix)"/share/fish/completions" + set -gx fish_complete_path $fish_complete_path (brew --prefix)/share/fish/completions +end + +if test -d (brew --prefix)"/share/fish/vendor_completions.d" + set -gx fish_complete_path $fish_complete_path (brew --prefix)/share/fish/vendor_completions.d +end diff --git a/home/dot_config/git/config.tmpl b/home/dot_config/git/config.tmpl index 061c8767..ec34cbc9 100644 --- a/home/dot_config/git/config.tmpl +++ b/home/dot_config/git/config.tmpl @@ -61,6 +61,7 @@ whitespace = trailing-space,space-before-tab [credential] helper = cache --timeout=3600 + credentialStore = {{ if eq .host.distro.id "darwin" }}keychain{{ else }}{{ if eq .host.distro.id "windows" }}wincredman{{ else }}secretservice{{ end }}{{ end }} [credential "https://github.com"] helper = !gh auth git-credential [credential "https://gist.github.com"] diff --git a/home/dot_config/shell/exports.sh.tmpl b/home/dot_config/shell/exports.sh.tmpl index d2c4f7f9..f0973d3f 100644 --- a/home/dot_config/shell/exports.sh.tmpl +++ b/home/dot_config/shell/exports.sh.tmpl @@ -361,6 +361,11 @@ export RUSTUP_HOME="$XDG_DATA_HOME/rustup" ### SDKMan export SDKMAN_DIR="$XDG_DATA_HOME/sdkman" +### Update +if [ -d "$HOME/.local/bin/update/bin" ]; then + export PATH="$PATH:$HOME/.local/bin/update/bin" +fi + ### Vagrant export VAGRANT_ALIAS_FILE="$XDG_CONFIG_HOME/vagrant/aliases" export VAGRANT_DEFAULT_PROVIDER=virtualbox diff --git a/home/dot_config/update/update-git-pull/directories/custom.txt b/home/dot_config/update/update-git-pull/directories/custom.txt new file mode 100644 index 00000000..e69de29b diff --git a/home/dot_config/update/update-git-pull/directories/default.txt b/home/dot_config/update/update-git-pull/directories/default.txt new file mode 100644 index 00000000..e69de29b diff --git a/home/dot_config/update/update-hg-pull/directories/custom.txt b/home/dot_config/update/update-hg-pull/directories/custom.txt new file mode 100644 index 00000000..e69de29b diff --git a/home/dot_config/update/update-hg-pull/directories/default.txt b/home/dot_config/update/update-hg-pull/directories/default.txt new file mode 100644 index 00000000..e69de29b diff --git a/home/dot_config/update/update-run-first/README.md b/home/dot_config/update/update-run-first/README.md new file mode 100644 index 00000000..9a9184ef --- /dev/null +++ b/home/dot_config/update/update-run-first/README.md @@ -0,0 +1,10 @@ +# Run first + +You can put any scripts you want into this directory, and the program +will run your scripts first, before any of the update commands. + +You may freely create subdirectories. + +The program runs the executable files. + +The program skips the non-executable files. \ No newline at end of file diff --git a/home/dot_config/update/update-run-last/README.md b/home/dot_config/update/update-run-last/README.md new file mode 100644 index 00000000..fd5a7516 --- /dev/null +++ b/home/dot_config/update/update-run-last/README.md @@ -0,0 +1,3 @@ +# Run last + +All executable scripts in this folder get run after all the other update commands. \ No newline at end of file diff --git a/home/dot_local/bin/executable_install-program-cache.tmpl b/home/dot_local/bin/executable_install-program-cache.tmpl new file mode 100644 index 00000000..90117f09 --- /dev/null +++ b/home/dot_local/bin/executable_install-program-cache.tmpl @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +if command -v brew > /dev/null; then + brew info --json=v1 --installed +fi diff --git a/home/dot_zshrc b/home/dot_zshrc index 0a78be01..d5057706 100644 --- a/home/dot_zshrc +++ b/home/dot_zshrc @@ -62,7 +62,7 @@ setopt SHARE_HISTORY if [ ! -d "$XDG_CACHE_HOME/zsh" ]; then mkdir -p "$XDG_CACHE_HOME/zsh" fi -autoload -U +X compinit && compinit -d "$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION" + zstyle ':completion:*:*:*:*:*' menu select zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache" zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' @@ -259,10 +259,6 @@ xterm*|rxvt*|Eterm|aterm|kterm|gnome*|alacritty) ;; esac -### Homebrew ZSH Completions -# Must be sourced before compinit / Oh-My-ZSH inclusion -FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}" - ### Antigen if [ -f "$HOME/.local/scripts/antigen.zsh" ]; then source "$HOME/.local/scripts/antigen.zsh" @@ -392,6 +388,19 @@ if command -v fzf > /dev/null; then zstyle ':autocomplete:*' fzf-completion yes fi +### Homebrew ZSH Completions +# Must be sourced before compinit / Oh-My-ZSH inclusion +FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}" + +### ZSH compinit +autoload -Uz +X compinit && compinit -d "$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION" + +### Bash Completions +autoload -U +X bashcompinit && bashcompinit +if [ -f "/usr/local/etc/profile.d/bash_completion.sh" ]; then + . "/usr/local/etc/profile.d/bash_completion.sh" +fi + ### Atuin if command -v atuin > /dev/null; then eval "$(atuin init zsh)" @@ -451,9 +460,6 @@ if command -v thefuck > /dev/null; then eval "$(thefuck --alias)" fi -### Bash Completions -autoload -U +X bashcompinit && bashcompinit - ### HashiCorp Vault if command -v vault > /dev/null; then complete -o nospace -C vault vault diff --git a/scripts/provision.sh b/scripts/provision.sh index c86a911f..2c9a27de 100644 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -252,25 +252,28 @@ fi # @description Ensure basic system packages are available on the device if ! command -v curl > /dev/null || ! command -v git > /dev/null || ! command -v expect > /dev/null || ! command -v rsync > /dev/null; then if command -v apt-get > /dev/null; then - # @description Ensure `build-essential`, `curl`, `expect`, `git`, and `rsync` are installed on Debian / Ubuntu + # @description Ensure `build-essential`, `curl`, `expect`, `git`, `rsync`, `procps`, and `file` are installed on Debian / Ubuntu sudo apt-get update - sudo apt-get install -y build-essential curl expect git rsync + sudo apt-get install -y build-essential curl expect git rsync procps file elif command -v dnf > /dev/null; then - # @description Ensure `curl`, `expect`, `git`, and `rsync` are installed on Fedora - sudo dnf install -y curl expect git rsync + # @description Ensure `curl`, `expect`, `git`, `rsync`, `procps-ng`, and `file` are installed on Fedora (as well as the Development Tools package) + sudo dnf groupinstall -y 'Development Tools' + sudo dnf install -y curl expect git rsync procps-ng file elif command -v yum > /dev/null; then - # @description Ensure `curl`, `expect`, `git`, and `rsync` are installed on CentOS - sudo yum install -y curl expect git rsync + # @description Ensure `curl`, `expect`, `git`, `rsync`, `procps-ng`, and `file` are installed on CentOS (as well as the Development Tools package) + sudo yum groupinstall -y 'Development Tools' + sudo yum install -y curl expect git rsync procps-ng file elif command -v pacman > /dev/null; then - # @description Ensure `curl`, `expect`, `git`, and `rsync` are installed on Archlinux + # @description Ensure `base-devel`, `curl`, `expect`, `git`, `rsync`, `procps-ng`, and `file` are installed on Archlinux sudo pacman update - sudo pacman -Sy curl expect git rsync + sudo pacman -Sy base-devel curl expect git rsync procps-ng file elif command -v zypper > /dev/null; then - # @description Ensure `curl`, `expect`, `git`, and `rsync` are installed on OpenSUSE - sudo zypper install -y curl expect git rsync + # @description Ensure `curl`, `expect`, `git`, `rsync`, `procps`, and `file` are installed on OpenSUSE (as well as the devel_basis pattern) + sudo zypper install -yt pattern devel_basis + sudo zypper install -y curl expect git rsync procps file elif command -v apk > /dev/null; then - # @description Ensure `curl`, `expect`, `git`, and `rsync` are installed on Alpine - apk add curl expect git rsync + # @description Ensure `curl`, `expect`, `git`, `rsync`, `procps`, and `file` are installed on Alpine + apk add build-base curl expect git rsync procps file elif [ -d /Applications ] && [ -d /Library ]; then # @description Ensure CLI developer tools are available on macOS (via `xcode-select`) sudo xcode-select -p >/dev/null 2>&1 || xcode-select --install diff --git a/software.yml b/software.yml index e487b23e..d536a0d6 100644 --- a/software.yml +++ b/software.yml @@ -1,6 +1,6 @@ --- # eslint-disable eslint-comments/disable-enable-pair, max-len, max-lines, no-warning-comments -# rhino mkvtoolnix testdisk ccat git-credential-manager source-highlight giter8 saltstack squid ettercap calc mongodb wdiff dialog john reaver oath-toolkit xhyve elm icdiff ddrescue gitlab-ci-multi-runner tcl-tk flac zenity terragrunt dbus grpc diffutils sonarqube haproxy cabal-install sonar-scanner wakeonlan tmate solr tcptraceroute hashcat handbrake iproute2mac 2fsprogs hydra you-get cabextract trash sphinx-doc iftop htop-osx dockutil xctool aspell w3m grc screenfetch moreutils brew-cask-completion openconnect media-info lftp unison logstash pstree rpm opam iperf3 libav gifsicle iperf colordiff lmdb mcrypt httprack aircrack-ng ntfs-3g glide glog parallel bison rename kubernetes-helm gdbm mobile-shell geckodriver pv sdl swig winetricks doxygen mtr graphicsmagick dos2unix highlight putty llvm flow watch gdb ant mariadb mercurial pidof autoconf maven readline libtool chromedriver pkg-config +# ettercap calc mongodb wdiff dialog john reaver oath-toolkit xhyve elm icdiff ddrescue gitlab-ci-multi-runner tcl-tk flac zenity terragrunt dbus grpc diffutils sonarqube haproxy cabal-install sonar-scanner tmate solr tcptraceroute hashcat handbrake iproute2mac 2fsprogs hydra you-get cabextract trash sphinx-doc iftop htop-osx w3m grc moreutils brew-cask-completion openconnect media-info lftp unison logstash pstree rpm iperf3 libav iperf colordiff lmdb mcrypt httprack aircrack-ng ntfs-3g glog parallel rename kubernetes-helm gdbm mobile-shell geckodriver pv sdl swig winetricks doxygen mtr graphicsmagick dos2unix highlight putty llvm flow watch gdb ant mariadb mercurial pidof autoconf maven readline libtool chromedriver pkg-config # `softwarePackages` is a map of possible package managers to use while installing a program. The installer will # look at the `installerPreference` variable and find the first package manager that is in the package's possible # installation method and then use that. It is also sensitive to the type of operating system so a package with @@ -868,6 +868,11 @@ softwarePackages: _home: https://astronvim.github.io/ _name: AstroNvim _post: nvim --headless -c 'autocmd User PackerComplete quitall' & + dockutil: + _bin: dockutil + _github: https://github.com/kcrawford/dockutil + _name: DockUtil + brew:darwin: dockutil platformio: _bin: platformio _github: https://github.com/platformio/platformio-core @@ -1053,6 +1058,13 @@ softwarePackages: _home: https://jamiemason.github.io/syncpack/ _name: Syncpack npm: syncpack + ccat: + _bin: ccat + _github: https://github.com/owenthereal/ccat + _name: ccat + brew: ccat + go: github.com/owenthereal/ccat@latest + pacman: ccat flake8: _bin: flake8 _desc: Flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code. @@ -1100,17 +1112,49 @@ softwarePackages: _name: bane github: github.com/genuinetools/bane go: github.com/genuinetools/bane@latest + openssl-osx-ca: + _bin: openssl-osx-ca + _github: https://github.com/raggi/openssl-osx-ca + _name: OpenSSL macOS CA + _service: openssl-osx-ca + brew:darwin: raggi/ale/openssl-osx-ca + meta-package-manager: + _bin: mpm + _github: https://github.com/kdeldycke/meta-package-manager + _name: Meta Package Manager + brew: meta-package-manager + pipx: meta-package-manager + yt-dlp: + _bin: yt-dlp + _github: https://github.com/yt-dlp/yt-dlp/wiki/Installation + _name: YouTube Download + brew: yt-dlp + choco: yt-dlp + pacman: yt-dlp + pipx: yt-dlp + scoop: yt-dlp + port: yt-dlp + winget: yt-dlp + brew-gem: + _bin: brew-gem + _github: https://github.com/sportngin/brew-gem + _name: Homebrew RubyGems + brew: brew-gem + brew-pkg: + _bin: brew-pkg + _github: https://github.com/timsutton/brew-pkg + _name: Homebrew Pkg + brew:darwin: timsutton/formulae/brew-pkg bash-completion: _bin: null _desc: null _docs: https://docs.brew.sh/Shell-Completion _github: null _home: null - _name: null - _when:darwin: '! brew list bash-completion | grep bash-completion > /dev/null' - _when:linux: '! brew list bash-completion | grep bash-completion > /dev/null' - brew:darwin: bash-completion - brew:linux: bash-completion + _name: Bash Completion Formula + _when: '! brew list bash-completion | grep bash-completion > /dev/null' + brew: bash-completion@2 + brew: bash-completion@2 axel: _bin: axel _docs: null @@ -6637,6 +6681,18 @@ softwarePackages: - gifski - peek yay: peek-git + + gifsicle: + _bin: gifsicle + _github: https://github.com/kohler/gifsicle + _name: Gifsicle + apt: gifsicle + brew: gifsicle + dnf: gifsicle + pacman: gifsicle + choco: gifsicle + scoop: gifsicle + port: gifsicle pgcli: _bin: pgcli _desc: '[pgcli](https://www.pgcli.com/) is a free and open-source CLI for Postgres that does auto-completion and syntax highlighting.' @@ -10050,6 +10106,21 @@ softwarePackages: dnf: tigervnc-server pacman: tigervnc zypper: tigervnc + proxyman: + _bin: proxyman + _github: https://github.com/ProxymanApp/Proxyman + _name: Proxyman + _when:cask: '! test -d /Applications/Proxyman.app && ! test -d $HOME/Applications/Proxyman.app' + cask: proxyman + squid: + _bin: squid + _github: https://github.com/squid-cache/squid + _name: Squid + _service: squid + apt: squid + brew: squid + dnf: squid + pacman: squid zap: _bin: zap _desc: Delightful AppImage package manager @@ -10179,6 +10250,7 @@ softwarePlugins: plugins: - microsoft.cst.attacksurfaceanalyzer.cli - dotnet-format + - git-credential-manager gcloud: cmd: bash -c 'if ! gcloud components list | grep "Installed.*{PLUGIN}" &> /dev/null; then gcloud components install "{PLUGIN}"; fi' plugins: