This commit is contained in:
Brian Zalewski 2023-07-12 04:32:13 +00:00
parent 8a5480fdf8
commit a3004df675
18 changed files with 593 additions and 561 deletions

View file

@ -980,7 +980,6 @@ softwareGroups:
Virtualization-Desktop: &Virtualization-Desktop Virtualization-Desktop: &Virtualization-Desktop
- docker-desktop - docker-desktop
- gnome-boxes - gnome-boxes
- orbstack
- parallels - parallels
- quickgui - quickgui
- utm - utm
@ -1412,6 +1411,8 @@ softwareGroups:
note: Deprecated in favor of using ASDF. note: Deprecated in favor of using ASDF.
- pkg: nuclear - pkg: nuclear
note: Music app - UI is horrendous note: Music app - UI is horrendous
- pkg: orbstack
note: Faster / better alternative to Docker Desktop on macOS. Deprecated because it does not support Docker Extensions and is only for macOS.
- pkg: pip - pkg: pip
note: The `pip` installation is handled by the `install-software` program bundled with Install Doctor. note: The `pip` installation is handled by the `install-software` program bundled with Install Doctor.
- pkg: pipx - pkg: pipx

View file

@ -66,7 +66,7 @@
type = "file" type = "file"
url = "https://gitlab.com/megabyte-labs/gas-station/-/raw/master/environments/prod/group_vars/all/helm.yml" url = "https://gitlab.com/megabyte-labs/gas-station/-/raw/master/environments/prod/group_vars/all/helm.yml"
refreshPeriod = "{{ $refreshPeriod }}" refreshPeriod = "{{ $refreshPeriod }}"
[".local/bash_it"] [".local/share/bash_it"]
type = "git-repo" type = "git-repo"
url = "https://github.com/Bash-it/bash-it.git" url = "https://github.com/Bash-it/bash-it.git"
refreshPeriod = "{{ $refreshPeriod }}" refreshPeriod = "{{ $refreshPeriod }}"

View file

@ -24,24 +24,27 @@
{{ includeTemplate "universal/profile" }} {{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }} {{ includeTemplate "universal/logg" }}
### Clone the repositories function gitomaticSetup() {
logg info 'Cloning the repositories' ### Clone the repositories
{{ range .user.gitomatic }} logg info 'Cloning the repositories'
if [ ! -d "{{ .path }}" ]; then {{ range .user.gitomatic }}
logg info 'Checking for presence of {{ .path }}'
if [ ! -d "{{ .path }}" ]; then
logg info 'Cloning {{ .git }} to {{ .path }}'
git clone "{{ .git }}" "{{ .path }}" git clone "{{ .git }}" "{{ .path }}"
fi fi
{{ end -}} {{ end -}}
### Create Systemd service to run gitomatic ### Create Systemd service to run gitomatic
if command -v gitomatic > /dev/null; then if command -v gitomatic > /dev/null; then
if [ -d /Applications ] && [ -d /System ]; then if [ -d /Applications ] && [ -d /System ]; then
### macOS ### macOS
logg info 'Copying `gitomatic` plist file to /Library/LaunchDaemons' logg info 'Copying `gitomatic` plist file to /Library/LaunchDaemons'
sudo cp -f "{{ .chezmoi.homeDir }}/.config/gitomatic/gitomatic.plist" /Library/LaunchDaemons/gitomatic.plist sudo cp -f "{{ .chezmoi.homeDir }}/.config/gitomatic/gitomatic.plist" /Library/LaunchDaemons/gitomatic.plist
logg info 'Running `sudo launchctl load com.gitomatic`' logg info 'Running `sudo launchctl load gitomatic`'
sudo launchctl load com.gitomatic sudo launchctl load gitomatic
logg info 'Running `sudo launchctl start com.gitomatic`' logg info 'Running `sudo launchctl start gitomatic`'
sudo launchctl start com.gitomatic sudo launchctl start gitomatic
else else
### Linux ### Linux
logg info 'Copying `gitomatic` systemd unit file to /etc/systemd/system/' logg info 'Copying `gitomatic` systemd unit file to /etc/systemd/system/'
@ -51,7 +54,9 @@ if command -v gitomatic > /dev/null; then
logg info 'Enabling and starting `gitomatic` service' logg info 'Enabling and starting `gitomatic` service'
sudo systemctl enable --now gitomatic sudo systemctl enable --now gitomatic
fi fi
else else
logg info 'Git-o-matic is not installed or it is not available in PATH' logg info 'Git-o-matic is not installed or it is not available in PATH'
fi fi
}
gitomaticSetup
{{ end -}} {{ end -}}

View file

@ -6,8 +6,11 @@
# This script pre-installs the VIM plugins defined in [`.chezmoidata.yaml`](https://github.com/megabyte-labs/install.doctor/tree/master/home/.chezmoidata.yaml) # This script pre-installs the VIM plugins defined in [`.chezmoidata.yaml`](https://github.com/megabyte-labs/install.doctor/tree/master/home/.chezmoidata.yaml)
# so that VIM does not have to do anything on its first launch. # so that VIM does not have to do anything on its first launch.
### Run the VIM plugin install routine function vimSetup() {
if command -v vim > /dev/null; then ### Run the VIM plugin install routine
vim +PlugInstall +qall 2>/dev/null if command -v vim > /dev/null; then
fi vim +PlugInstall +qall 2>/dev/null && logg success 'Successfully ran `vim +PlugInstall +qall`' || logg error 'Failed to run `vim +PlugInstall +qll`'
fi
}
vimSetup
{{ end -}} {{ end -}}

View file

@ -28,8 +28,9 @@
{{ includeTemplate "universal/profile" }} {{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }} {{ includeTemplate "universal/logg" }}
### Ensure Chrome policies directory is present function chromeSetUp() {
for POLICY_DIR in "/opt/google/chrome/policies" "/etc/chromium/policies" "/etc/brave/policies"; do ### Ensure Chrome policies directory is present
for POLICY_DIR in "/opt/google/chrome/policies" "/etc/chromium/policies" "/etc/brave/policies"; do
if [ -d "$(dirname "$POLICY_DIR")" ]; then if [ -d "$(dirname "$POLICY_DIR")" ]; then
### Managed policies ### Managed policies
if [ ! -f "$POLICY_DIR/managed/policies.json" ]; then if [ ! -f "$POLICY_DIR/managed/policies.json" ]; then
@ -49,10 +50,10 @@ for POLICY_DIR in "/opt/google/chrome/policies" "/etc/chromium/policies" "/etc/b
else else
logg info "Skipping extension injection into $POLICY_DIR - create these folders prior to running to create managed configs" logg info "Skipping extension injection into $POLICY_DIR - create these folders prior to running to create managed configs"
fi fi
done done
### Add Chrome extension JSON ### Add Chrome extension JSON
for EXTENSION_DIR in "/opt/google/chrome/extensions" "/etc/chromium/extensions" "/etc/brave/extensions" "$HOME/Library/Application Support/Google/Chrome/External Extensions" "$HOME/Library/Application Support/Microsoft/Edge/External Extensions" "$HOME/Library/Application Support/BraveSoftware/Brave-Browser/External Extensions"; do for EXTENSION_DIR in "/opt/google/chrome/extensions" "/etc/chromium/extensions" "/etc/brave/extensions" "$HOME/Library/Application Support/Google/Chrome/External Extensions" "$HOME/Library/Application Support/Microsoft/Edge/External Extensions" "$HOME/Library/Application Support/BraveSoftware/Brave-Browser/External Extensions"; do
### Ensure program-type is installed ### Ensure program-type is installed
if [ -d "$(dirname "$EXTENSION_DIR")" ]; then if [ -d "$(dirname "$EXTENSION_DIR")" ]; then
### Ensure extension directory exists ### Ensure extension directory exists
@ -85,6 +86,8 @@ for EXTENSION_DIR in "/opt/google/chrome/extensions" "/etc/chromium/extensions"
else else
logg info "$EXTENSION_DIR does not exist" logg info "$EXTENSION_DIR does not exist"
fi fi
done done
}
chromeSetUp
{{ end -}} {{ end -}}

View file

@ -49,8 +49,9 @@
# Firefox plugins: {{ list (.firefoxAddOns | toString | replace "[" "" | replace "]" "") | uniq | join " " }} # Firefox plugins: {{ list (.firefoxAddOns | toString | replace "[" "" | replace "]" "") | uniq | join " " }}
### Installs the Firefox Profile Connector on Linux systems (Snap / Flatpak installs are not included in this function, but instead inline below) function firefoxSetup() {
function installFirefoxProfileConnector() { ### Installs the Firefox Profile Connector on Linux systems (Snap / Flatpak installs are not included in this function, but instead inline below)
function installFirefoxProfileConnector() {
logg info 'Installing the Firefox Profile Connector' logg info 'Installing the Firefox Profile Connector'
if command -v apt-get > /dev/null; then if command -v apt-get > /dev/null; then
sudo apt-get install -y https://github.com/null-dev/firefox-profile-switcher-connector/releases/latest/download/linux-x64.deb sudo apt-get install -y https://github.com/null-dev/firefox-profile-switcher-connector/releases/latest/download/linux-x64.deb
@ -62,18 +63,18 @@ function installFirefoxProfileConnector() {
logg warn 'apt-get, dnf, and yay were all unavailable so the Firefox Profile Connector helper executable could not be installed' logg warn 'apt-get, dnf, and yay were all unavailable so the Firefox Profile Connector helper executable could not be installed'
fi fi
} }
### Add Firefox enterprise profile ### Add Firefox enterprise profile
# TODO - figure out how to do this for other installations like Flatpak and macOS and Librewolf # TODO - figure out how to do this for other installations like Flatpak and macOS and Librewolf
for FIREFOX_DIR in '/usr/lib/firefox' '/usr/lib/firefox-esr' '/etc/firefox' '/etc/firefox-esr' '/Applications/Firefox.app/Contents/Resources' '/Applications/LibreWolf.app/Contents/Resources/'; do for FIREFOX_DIR in '/usr/lib/firefox' '/usr/lib/firefox-esr' '/etc/firefox' '/etc/firefox-esr' '/Applications/Firefox.app/Contents/Resources' '/Applications/LibreWolf.app/Contents/Resources/'; do
if [ -d "$FIREFOX_DIR" ] && [ -d "${XDG_DATA_HOME:-$HOME/.local/share}/firefox" ] && command -v rsync > /dev/null; then if [ -d "$FIREFOX_DIR" ] && [ -d "${XDG_DATA_HOME:-$HOME/.local/share}/firefox" ] && command -v rsync > /dev/null; then
sudo rsync -artvu "${XDG_DATA_HOME:-$HOME/.local/share}/firefox/" "$FIREFOX_DIR" sudo rsync -artvu "${XDG_DATA_HOME:-$HOME/.local/share}/firefox/" "$FIREFOX_DIR"
fi fi
done done
### Loop through various Firefox profile locations ### Loop through various Firefox profile locations
for SETTINGS_DIR in "$HOME/snap/firefox/common/.mozilla/firefox" "$HOME/.var/app/org.mozilla.firefox/.mozilla/firefox" "$HOME/.var/app/io.gitlab.librewolf-community/.librewolf" "$HOME/Library/Application Support/Firefox/Profiles" "$HOME/Library/Application Support/LibreWolf/Profiles" "$HOME/.mozilla/firefox"; do for SETTINGS_DIR in "$HOME/snap/firefox/common/.mozilla/firefox" "$HOME/.var/app/org.mozilla.firefox/.mozilla/firefox" "$HOME/.var/app/io.gitlab.librewolf-community/.librewolf" "$HOME/Library/Application Support/Firefox/Profiles" "$HOME/Library/Application Support/LibreWolf/Profiles" "$HOME/.mozilla/firefox"; do
### Determine executable to use ### Determine executable to use
logg info "Processing Firefox profile location $SETTINGS_DIR" logg info "Processing Firefox profile location $SETTINGS_DIR"
unset FIREFOX_EXE unset FIREFOX_EXE
@ -321,6 +322,7 @@ for SETTINGS_DIR in "$HOME/snap/firefox/common/.mozilla/firefox" "$HOME/.var/app
fi fi
done done
fi fi
done done
}
firefoxSetup
{{ end -}} {{ end -}}

View file

@ -1,44 +0,0 @@
{{- if ne .host.distro.family "windows" -}}
#!/usr/bin/env bash
# @file Vagrant VMWare Utility
# @brief Installs the `vagrant-vmware-utility` if both Vagrant and VMWare are installed
# @description
# This script first checks if `vagrant`, `vmware`, and `vagrant-vmware-utility` are available in the `PATH`. If they are present, then the script
# configures the [`vagrant-vmware-utility`](https://developer.hashicorp.com/vagrant/docs/providers/vmware/vagrant-vmware-utility) by generating the required security certificates and enabling the service.
# This system package enables the capability of controlling both VMWare Workstation and VMWare Fusion with Vagrant.
#
# Since this script runs only when `vagrant`, `vmware`, and `vagrant-vmware-utility` are in the `PATH`, this means that it will run
# when you use an installation template that includes all three pieces of software in the software list defined in
# `home/.chezmoidata.yaml`.
#
# ## Links
#
# * [Vagrant VMWare Utility on GitHub](https://github.com/hashicorp/vagrant-vmware-desktop)
# * [`home/.chezmoidata.yaml`](https://github.com/megabyte-labs/install.doctor/blob/master/home/.chezmoidata.yaml)
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
# @description Only run logic if both Vagrant and VMWare are installed
if command -v vagrant > /dev/null && command -v vmware-id > /dev/null; then
# @description Vagrant VMWare Utility configuration
if command -v vagrant-vmware-utility > /dev/null; then
if [ -f /usr/local/bin/certificates/vagrant-utility.key ]; then
logg info 'Assuming Vagrant VMWare Utility certificates have been properly generated since /usr/local/bin/certificates/vagrant-utility.key is present'
else
logg info 'Generating Vagrant VMWare Utility certificates'
sudo vagrant-vmware-utility certificate generate
logg success 'Generated Vagrant VMWare Utility certificates via `vagrant-vmware-utility certificate generate`'
fi
logg info 'Ensuring the Vagrant VMWare Utility service is enabled'
sudo vagrant-vmware-utility service install || EXIT_CODE=$?
if [ -n "$EXIT_CODE" ]; then
logg info 'The Vagrant VMWare Utility command `vagrant-vmware-utility service install` failed. It is probably already setup.'
fi
fi
else
logg info 'Vagrant is not installed so the Vagrant plugins will not be installed'
logg info 'Vagrant or VMWare is not installed so the Vagrant VMWare utility will not be configured'
fi
{{ end -}}

View file

@ -1,76 +0,0 @@
{{- if eq .host.distro.family "linux" -}}
{{- $softwareGroup := nospace (cat "_" .host.softwareGroup) -}}
{{- $softwareList := list (index .softwareGroups $softwareGroup | toString | replace "[" "" | replace "]" "") | uniq | join " " -}}
{{- if (contains " vmware" $softwareList) -}}
#!/usr/bin/env bash
# @file Linux VMWare Workstation Install
# @brief Installs VMWare Workstation Pro on Linux devices, applies a "publicly-retrieved" license key (see disclaimer), and automatically accepts the terms and conditions
# @description
# This script ensures the user included `vmware` in their software installation list. It then checks for presence of the `vmware` utility. If it is not present, then the script:
#
# 1. Downloads the [VMWare Workstation Pro](https://www.vmware.com/content/vmware/vmware-published-sites/us/products/workstation-pro.html.html) Linux installer
# 2. Installs VMWare Workstation Pro
# 3. Passes options to the installation script that automatically apply a publicly retrived license key and accept the Terms & Conditions
#
# **DISCLAIMER:** If you plan on using VMWare Workstation for anything but evaluation purposes, then we highly suggest purchasing a copy
# of VMWare Workstation. The "publicly-retrived" license keys are scattered throughout GitHub and we are not exactly
# sure why they work. You can pass in your own key by utilizing the `VMWARE_WORKSTATION_LICENSE_KEY` environment variable. More details on
# using environment variables or repository-housed encrypted secrets can be found in our [Secrets documentation](https://install.doctor/docs/customization/secrets).
#
# ## VMWare on macOS
#
# This script only installs VMWare Workstation on Linux. The macOS-variant titled VMWare Fusion can be installed using a Homebrew
# cask so a "work-around" script does not have to be used.
#
# ## VMWare vs. Parallels vs. VirtualBox vs. KVM vs. Hyper-V
#
# There are a handful of VM virtualization providers you can choose from. VMWare is a nice compromise between OS compatibility and performance.
# Parallels, on the hand, might be better for macOS since it is designed specifically for macOS. Finally, VirtualBox is a truly free,
# open-source option that does not come with the same optimizations that VMWare and Parallels provide.
#
# Other virtualization options include KVM (Linux / macOS) and Hyper-V (Windows). These options are better used for headless
# systems.
#
# ## Links
#
# * [VMWare Workstation homepage](https://www.vmware.com/content/vmware/vmware-published-sites/us/products/workstation-pro.html.html)
{{- $secretKey := "" -}}
{{- if (stat (joinPath (.chezmoi.sourceDir ".chezmoitemplates" "secrets" "VMWARE_WORKSTATION_LICENSE_KEY"))) -}}
{{- $secretKey = (default "4C21U-2KK9Q-M8130-4V2QH-CF810" (includeTemplate "secrets/VMWARE_WORKSTATION_LICENSE_KEY" | decrypt | trim)) -}}
{{- else -}}
{{- $secretKey = (default "4C21U-2KK9Q-M8130-4V2QH-CF810" (env "VMWARE_WORKSTATION_LICENSE_KEY")) -}}
{{- end }}
# Source: https://gist.github.com/PurpleVibe32/30a802c3c8ec902e1487024cdea26251
# key: {{ $secretKey }}
{{ includeTemplate "universal/profile-before" }}
{{ includeTemplate "universal/logg-before" }}
### Install VMware Workstation
if ! command -v vmware > /dev/null; then
### Download VMWare Workstation
logg info 'VMware Workstation is not installed'
VMWARE_WORKSTATION_URL=https://www.vmware.com/go/getworkstation-linux
VMWARE_WORKSTATION_DIR=/tmp/workstation-downloads
mkdir -p $VMWARE_WORKSTATION_DIR
logg info 'Downloading VMware Workstation Installer'
curl -sSLA "Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20220101 Firefox/102.0" "$VMWARE_WORKSTATION_URL" -o "$VMWARE_WORKSTATION_DIR/tryworkstation-linux-64.sh"
### Register product key / license
VMWARE_WORKSTATION_LICENSE_KEY='{{- $secretKey -}}'
if [ -n "$VMWARE_WORKSTATION_LICENSE_KEY" ]; then
logg info 'Registering VMware Workstation Pro license with serial number'
sudo "$VMWARE_WORKSTATION_DIR/tryworkstation-linux-64.sh" --eulas-agreed --console --required --set-setting vmware-workstation serialNumber "$VMWARE_WORKSTATION_LICENSE_KEY"
else
logg info 'Agreeing to VMWare Workstation Pro license (without serial number)'
sudo "$VMWARE_WORKSTATION_DIR/tryworkstation-linux-64.sh" --eulas-agreed --console --required
fi
logg success 'VMware Workstation installed successfully'
else
logg info 'VMware Workstation is already installed'
fi
{{ end -}}
{{ end -}}

View file

@ -1,15 +1,103 @@
{{- if eq .host.distro.family "linux" -}}
#!/usr/bin/env bash #!/usr/bin/env bash
# @file Linux VMWare Workstation Install
# @brief Installs VMWare Workstation Pro on Linux devices, applies a "publicly-retrieved" license key (see disclaimer), and automatically accepts the terms and conditions
# @description
# This script ensures the user included `vmware` in their software installation list. It then checks for presence of the `vmware` utility. If it is not present, then the script:
#
# 1. Downloads the [VMWare Workstation Pro](https://www.vmware.com/content/vmware/vmware-published-sites/us/products/workstation-pro.html.html) Linux installer
# 2. Installs VMWare Workstation Pro
# 3. Passes options to the installation script that automatically apply a publicly retrived license key and accept the Terms & Conditions
#
# **DISCLAIMER:** If you plan on using VMWare Workstation for anything but evaluation purposes, then we highly suggest purchasing a copy
# of VMWare Workstation. The "publicly-retrived" license keys are scattered throughout GitHub and we are not exactly
# sure why they work. You can pass in your own key by utilizing the `VMWARE_WORKSTATION_LICENSE_KEY` environment variable. More details on
# using environment variables or repository-housed encrypted secrets can be found in our [Secrets documentation](https://install.doctor/docs/customization/secrets).
#
# ## VMWare on macOS
#
# This script only installs VMWare Workstation on Linux. The macOS-variant titled VMWare Fusion can be installed using a Homebrew
# cask so a "work-around" script does not have to be used.
#
# ## VMWare vs. Parallels vs. VirtualBox vs. KVM vs. Hyper-V
#
# There are a handful of VM virtualization providers you can choose from. VMWare is a nice compromise between OS compatibility and performance.
# Parallels, on the hand, might be better for macOS since it is designed specifically for macOS. Finally, VirtualBox is a truly free,
# open-source option that does not come with the same optimizations that VMWare and Parallels provide.
#
# Other virtualization options include KVM (Linux / macOS) and Hyper-V (Windows). These options are better used for headless
# systems.
#
# ## Links
#
# * [VMWare Workstation homepage](https://www.vmware.com/content/vmware/vmware-published-sites/us/products/workstation-pro.html.html)
# @file Vagrant VMWare Utility
# @brief Installs the `vagrant-vmware-utility` if both Vagrant and VMWare are installed
# @description
# This script first checks if `vagrant`, `vmware`, and `vagrant-vmware-utility` are available in the `PATH`. If they are present, then the script
# configures the [`vagrant-vmware-utility`](https://developer.hashicorp.com/vagrant/docs/providers/vmware/vagrant-vmware-utility) by generating the required security certificates and enabling the service.
# This system package enables the capability of controlling both VMWare Workstation and VMWare Fusion with Vagrant.
#
# Since this script runs only when `vagrant`, `vmware`, and `vagrant-vmware-utility` are in the `PATH`, this means that it will run
# when you use an installation template that includes all three pieces of software in the software list defined in
# `home/.chezmoidata.yaml`.
#
# ## Links
#
# * [Vagrant VMWare Utility on GitHub](https://github.com/hashicorp/vagrant-vmware-desktop)
# * [`home/.chezmoidata.yaml`](https://github.com/megabyte-labs/install.doctor/blob/master/home/.chezmoidata.yaml)
# @file VMWare Configuration # @file VMWare Configuration
# @brief Patches VMWare to leverage kernel optimizations, support macOS, and work harmoniously with Secure Boot. It also enables optional services such as the USB service. # @brief Patches VMWare to leverage kernel optimizations, support macOS, and work harmoniously with Secure Boot. It also enables optional services such as the USB service.
# @description # @description
# This script performs various VMWare optimizations that allow VMWare to work optimally with all features enabled. # This script performs various VMWare optimizations that allow VMWare to work optimally with all features enabled.
{{- $softwareGroup := nospace (cat "_" .host.softwareGroup) -}}
{{- $softwareList := list (index .softwareGroups $softwareGroup | toString | replace "[" "" | replace "]" "") | uniq | join " " -}}
{{- $secretKey := "" -}}
{{- if (stat (joinPath (.chezmoi.sourceDir ".chezmoitemplates" "secrets" "VMWARE_WORKSTATION_LICENSE_KEY"))) -}}
{{- $secretKey = (default "4C21U-2KK9Q-M8130-4V2QH-CF810" (includeTemplate "secrets/VMWARE_WORKSTATION_LICENSE_KEY" | decrypt | trim)) -}}
{{- else -}}
{{- $secretKey = (default "4C21U-2KK9Q-M8130-4V2QH-CF810" (env "VMWARE_WORKSTATION_LICENSE_KEY")) -}}
{{- end }}
# Source: https://gist.github.com/PurpleVibe32/30a802c3c8ec902e1487024cdea26251
# key: {{ $secretKey }}
{{ includeTemplate "universal/profile" }} {{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }} {{ includeTemplate "universal/logg" }}
### Run logic if VMware is installed function vmwareSetup() {
if command -v vmware > /dev/null; then ### Run on Linux only
if [ -f /etc/os-release ]; then
### Run if vmware is to be installed
{{- if (contains " vmware" $softwareList) -}}
### Install VMware Workstation
if ! command -v vmware > /dev/null; then
### Download VMWare Workstation
logg info 'VMware Workstation is not installed'
VMWARE_WORKSTATION_URL=https://www.vmware.com/go/getworkstation-linux
VMWARE_WORKSTATION_DIR=/tmp/workstation-downloads
mkdir -p $VMWARE_WORKSTATION_DIR
logg info 'Downloading VMware Workstation Installer'
curl -sSLA "Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20220101 Firefox/102.0" "$VMWARE_WORKSTATION_URL" -o "$VMWARE_WORKSTATION_DIR/tryworkstation-linux-64.sh"
### Register product key / license
VMWARE_WORKSTATION_LICENSE_KEY='{{- $secretKey -}}'
if [ -n "$VMWARE_WORKSTATION_LICENSE_KEY" ]; then
logg info 'Registering VMware Workstation Pro license with serial number'
sudo "$VMWARE_WORKSTATION_DIR/tryworkstation-linux-64.sh" --eulas-agreed --console --required --set-setting vmware-workstation serialNumber "$VMWARE_WORKSTATION_LICENSE_KEY"
else
logg info 'Agreeing to VMWare Workstation Pro license (without serial number)'
sudo "$VMWARE_WORKSTATION_DIR/tryworkstation-linux-64.sh" --eulas-agreed --console --required
fi
logg success 'VMware Workstation installed successfully'
else
logg info 'VMware Workstation is already installed'
fi
{{ end -}}
### Run logic if VMware is installed
if command -v vmware > /dev/null; then
### Build kernel modules if they are not present ### Build kernel modules if they are not present
if [ ! -f "/lib/modules/$(uname -r)/misc/vmmon.ko" ] || [ ! -f "/lib/modules/$(uname -r)/misc/vmnet.ko" ]; then if [ ! -f "/lib/modules/$(uname -r)/misc/vmmon.ko" ] || [ ! -f "/lib/modules/$(uname -r)/misc/vmnet.ko" ]; then
### Build VMWare host modules ### Build VMWare host modules
@ -83,8 +171,32 @@ if command -v vmware > /dev/null; then
else else
logg info 'VMware host modules are present' logg info 'VMware host modules are present'
fi fi
else else
logg warn 'VMware Workstation is not installed so the VMware Unlocker will not be installed' logg warn 'VMware Workstation is not installed so the VMware Unlocker will not be installed'
fi fi
fi
{{ end -}} # @description Only run logic if both Vagrant and VMWare are installed
if command -v vagrant > /dev/null && command -v vmware-id > /dev/null; then
# @description Vagrant VMWare Utility configuration
if command -v vagrant-vmware-utility > /dev/null; then
if [ -f /usr/local/bin/certificates/vagrant-utility.key ]; then
logg info 'Assuming Vagrant VMWare Utility certificates have been properly generated since /usr/local/bin/certificates/vagrant-utility.key is present'
else
logg info 'Generating Vagrant VMWare Utility certificates'
sudo vagrant-vmware-utility certificate generate
logg success 'Generated Vagrant VMWare Utility certificates via `vagrant-vmware-utility certificate generate`'
fi
logg info 'Ensuring the Vagrant VMWare Utility service is enabled'
sudo vagrant-vmware-utility service install || EXIT_CODE=$?
if [ -n "$EXIT_CODE" ]; then
logg info 'The Vagrant VMWare Utility command `vagrant-vmware-utility service install` failed. It is probably already setup.'
fi
fi
else
logg info 'Vagrant is not installed so the Vagrant plugins will not be installed'
logg info 'Vagrant or VMWare is not installed so the Vagrant VMWare utility will not be configured'
fi
}
vmwareSetup

View file

@ -21,19 +21,33 @@ if command -v powerline > /dev/null && [ -f "$HOME/.bashrc" ]; then
# logg info 'Running `source ~/.bashrc`' # logg info 'Running `source ~/.bashrc`'
# source ~/.bashrc # source ~/.bashrc
# logg success 'Imported the `~/.bashrc` profile' # logg success 'Imported the `~/.bashrc` profile'
if command -v bash-it > /dev/null; then if [ -d "$BASH_IT" ]; then
if [ -n "$BASH_IT" ]; then ### Ensure bash-it is installed
cd "$BASH_IT" || logg warn "The $BASH_IT directory does not exist" if ! command -v bash-it > /dev/null; then
logg info 'Enabling bash-it completions' logg info 'Installing `bash-it` since it is not available yet as a command'
yes | bash-it enable completion defaults dirs docker docker-compose export git makefile ng npm ssh system vagrant bash "$BASH_IT/install.sh" --silent --no-modify-config
logg info 'Enabling bash-it plugins'
yes | bash-it enable plugin base blesh browser cht-sh dirs gitstatus powerline sudo xterm
logg info 'Finished enabling bash-it functions'
else
logg warn 'The BASH_IT variable needs to be defined'
fi fi
### Ensure completions are enabled
cd "$BASH_IT/enabled"
logg info 'Enabling bash-it completions'
# TODO: Move these plugins to the .chezmoidata.yaml
for COMPLETION in defaults dirs docker docker-compose export git makefile ng npm ssh system vagrant; do
if ! ls "$BASH_IT/enabled" | grep "$COMPLETION" > /dev/null; then
echo y | bash-it enable completion dirs > /dev/null && logg info "Enabled the bash-it $COMPLETION completion plugin" || logg error "Failed to install the $COMPLETION bash-it completion plugin"
fi
done
### Ensure plugins are enabled
logg info 'Enabling bash-it plugins'
# TODO: Move these plugins to the .chezmoidata.yaml
for PLUGIN in base blesh browser cht-sh dirs gitstatus powerline sudo xterm; do
if ls "$BASH_IT/enabled" | grep "$PLUGIN" > /dev/null; then
echo y | bash-it enable plugin "$PLUGIN" > /dev/null && logg info "Enabled the bash-it $PLUGIN plugin" || logg error "Failed to install the $PLUGIN bash-it plugin"
fi
done
else else
logg warn '`bash-it` is not available' logg warn 'The path specified by BASH_IT does not exist yet'
fi fi
else else
if ! command -v powerline > /dev/null; then if ! command -v powerline > /dev/null; then

View file

@ -248,7 +248,7 @@ if command -v cloudflared > /dev/null && [ -d "$HOME/.local/etc/cloudflared" ];
fi fi
TUNNEL_ID="$(cloudflared tunnel list | grep "host-{{ .host.hostname }}" | sed 's/ .*//')" TUNNEL_ID="$(cloudflared tunnel list | grep "host-{{ .host.hostname }}" | sed 's/ .*//')"
logg info "Tunnel ID: $TUNNEL_ID" logg info "Tunnel ID: $TUNNEL_ID"
if [ -f "/usr/local/etc/cloudflared/${TUNNEL_ID}.json" ] if [ -f "/usr/local/etc/cloudflared/${TUNNEL_ID}.json" ]; then
logg info 'Symlinking tunnel configuration to /usr/local/etc/cloudflared/credentials.json' logg info 'Symlinking tunnel configuration to /usr/local/etc/cloudflared/credentials.json'
rm -f /usr/local/etc/cloudflared/credentials.json rm -f /usr/local/etc/cloudflared/credentials.json
sudo ln -s "/usr/local/etc/cloudflared/${TUNNEL_ID}.json" /usr/local/etc/cloudflared/credentials.json sudo ln -s "/usr/local/etc/cloudflared/${TUNNEL_ID}.json" /usr/local/etc/cloudflared/credentials.json

View file

@ -19,6 +19,16 @@ if command -v brew > /dev/null; then
brew bundle --verbose --no-lock --file=/dev/stdin <<EOF brew bundle --verbose --no-lock --file=/dev/stdin <<EOF
{{ includeTemplate "darwin/Brewfile" . -}} {{ includeTemplate "darwin/Brewfile" . -}}
EOF EOF
### Ensure Python version is 3.11 or higher
PYTHON_VERSION="$(python3 --version | sed 's/Python //')"
MIN_PYTHON_VERSION="3.11.0"
if [ "$(printf '%s\n' "$MIN_PYTHON_VERSION" "$PYTHON_VERSION" | sort -V | head -n1)" = "$MIN_PYTHON_VERSION" ]; then
logg info "Minimum Python version satisfied (minimum: $MIN_PYTHON_VERSION, current: $PYTHON_VERSION)"
else
logg info 'Updating Python 3 version with `brew link --overwrite python@3.11`'
brew link --overwrite python@3.11
fi
else else
logg error '`brew` was not found in the PATH' logg error '`brew` was not found in the PATH'
fi fi

View file

@ -20,6 +20,7 @@ brew "gum"
brew "jq" brew "jq"
brew "node" brew "node"
brew "progress" brew "progress"
brew "python@3.11"
tap "go-task/tap" tap "go-task/tap"
brew "go-task/tap/go-task" brew "go-task/tap/go-task"
brew "volta" brew "volta"

View file

@ -47,7 +47,7 @@ if [ "$BASH_SUPPORT" = 'true' ]; then
# Prompt (on bash only) # Prompt (on bash only)
if [[ "$(hostname)" != *'-minimal' ]]; then if [[ "$(hostname)" != *'-minimal' ]]; then
### Styled Terminal ### Styled Terminal
export BASH_IT="$HOME/.local/bash_it" export BASH_IT="${XDG_DATA_HOME:-$HOME/.local/share}/bash_it"
export BASH_IT_THEME="powerline" export BASH_IT_THEME="powerline"
if command -v powerline-daemon > /dev/null && [ -f "$BASH_IT/bash_it.sh" ]; then if command -v powerline-daemon > /dev/null && [ -f "$BASH_IT/bash_it.sh" ]; then
. "$BASH_IT/bash_it.sh" . "$BASH_IT/bash_it.sh"

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -78,7 +78,7 @@
"jest-html-reporters", "jest-html-reporters",
{ {
"filename": "index.html", "filename": "index.html",
"logoImgPath": "~/.local/megabyte-labs/assets/icon-jest.png", "logoImgPath": "~/.local/assets/icon-jest.png",
"openReport": true, "openReport": true,
"pageTitle": "Code Coverage Report", "pageTitle": "Code Coverage Report",
"publicPath": "./coverage" "publicPath": "./coverage"

View file

@ -1,11 +1,5 @@
# shellcheck disable=SC1090,SC1091,SC2034,SC2154,SC2296 # shellcheck disable=SC1090,SC1091,SC2034,SC2154,SC2296
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
### Language / Fonts ### Language / Fonts
export LANG="en_US" export LANG="en_US"
export LC_ALL="en_US.UTF-8" export LC_ALL="en_US.UTF-8"
@ -19,6 +13,12 @@ if [ -f "$HOME/.config/shell/profile.sh" ]; then
. "$XDG_CONFIG_HOME/shell/profile.sh" . "$XDG_CONFIG_HOME/shell/profile.sh"
fi fi
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
### Misc. ### Misc.
export HISTFILE="$XDG_STATE_HOME/zsh/history" export HISTFILE="$XDG_STATE_HOME/zsh/history"
export ZLE_RPROMPT_INDENT=0 export ZLE_RPROMPT_INDENT=0

View file

@ -10028,16 +10028,17 @@ softwarePlugins:
docker: docker:
cmd: bash -c 'if ! docker extension list | grep "{PLUGIN}" > /dev/null; then echo y | docker extension install "{PLUGIN}"; fi' cmd: bash -c 'if ! docker extension list | grep "{PLUGIN}" > /dev/null; then echo y | docker extension install "{PLUGIN}"; fi'
plugins: plugins:
- docker/disk-usage-extension - ambassador/telepresence-docker-extension:1.0.13
- docker/logs-explorer-extension - docker/disk-usage-extension:0.2.7
- docker/logs-explorer-extension:0.2.3
- docker/resource-usage-extension - docker/resource-usage-extension
- docker/volumes-backup-extension:main - docker/volumes-backup-extension:main:1.1.4
- drone/drone-ci-docker-extension - drone/drone-ci-docker-extension:0.2.0
- okteto/docker-desktop-extension - okteto/docker-desktop-extension:0.3.3
- portainer/portainer-docker-extension - portainer/portainer-docker-extension:2.18.4
- redhatdeveloper/openshift-dd-ext - redhatdeveloper/openshift-dd-ext
- snyk/snyk-docker-desktop-extension - snyk/snyk-docker-desktop-extension
- tailscale/docker-extension - tailscale/docker-extension:1.0.0
dockerImages: dockerImages:
cmd: null cmd: null
plugins: plugins: