LatestLatest

This commit is contained in:
Brian Zalewski 2023-11-05 06:08:59 +00:00
parent 7dfdde96be
commit 71bc857336
8 changed files with 73 additions and 57 deletions

View file

@ -6,6 +6,9 @@
# This script ensures macOS has tools like `git` by installing the Xcode command-line developer tools if they are
# not already installed. Then, on both Linux and macOS, it ensures Homebrew is installed.
#
# It also tries to perform a system update and there may be some manual work required since it is not possible
# to completely automate the system update process for macOS.
#
# ## Environment Variables
#
# * `NO_RESTART` - Set this variable to skip restarts triggered by system updates on macOS
@ -52,7 +55,7 @@ fi
if [ -d /Applications ] && [ -d /Library ] && [ -z "$NO_RESTART" ]; then
if command -v gtimeout > /dev/null; then
# Allow 8 minutes for system updates
logg info 'Ensuring system software is upgraded (timing out after 8 minutes if system upgrade fails)'
logg info 'Ensuring system software is upgraded (timing out after 50 minutes if system upgrade fails)'
sudo gtimeout 3000 softwareupdate -i -a -R || logg warn 'The system update command timed out after 50 minutes'
else
# If gtimeout is unavailable, then attempt system upgrade without a timeout (which usually works on fresh systems)

View file

@ -23,7 +23,7 @@ if [ -d /Applications ] && [ -d /System ]; then
# To disable, run: sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off
# Only enable when computer is not a corporate / work computer
logg info 'Enabling VNC using the VNC_PASSWORD variable which is vncpass when nothing is specified'
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -allowAccessFor -specifiedUsers -clientopts -setreqperm -reqperm yes -setvnclegacy -vnclegacy yes -setvncpw -vncpw "{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "VNC_PASSWORD")) }}{{ includeTemplate "secrets/VNC_PASSWORD" | decrypt | trim }}{{ else }}{{ default "vncpass" (env "VNC_PASSWORD") }}{{ end }}" -restart -agent -privs -all -users "$USER"
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -allowAccessFor -specifiedUsers -clientopts -setreqperm -reqperm yes -setvnclegacy -vnclegacy yes -setvncpw -vncpw "{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "VNC_PASSWORD")) }}{{ includeTemplate "secrets/VNC_PASSWORD" | decrypt | trim }}{{ else }}{{ default "vncpass" (env "VNC_PASSWORD") }}{{ end }}" -restart -agent -privs -all -users "$USER" && logg success 'Finished running the macOS Remote Management kickstart executable'
else
# System is Linux
### VNC set-up / configuration

View file

@ -0,0 +1,65 @@
{{- if (ne .host.distro.family "windows") -}}
#!/usr/bin/env bash
# @file Delta / GH (GitHub CLI) Install
# @brief Ensures Delta and GH (the GitHub CLI) are installed via Homebrew
# @description
# This script installs various libraries that are loosely required by the eco-system that Install Doctor
# implements. It installs the following:
#
# 1. `delta` - Delta is used by the git config as an alternate, improved pager terminal user-interface
# 2. `gh` - GH (GitHub CLI) is included as a dependency for generating the global git config helper since GH provides a credential helper that can be used to authenticate calls on `github.com`.
# 3. `go` - The Go framework
#
# The script will check for the presence of each program before trying to install it via Homebrew. If any of these
# requirements are to be installed via native package managers, then the dependency should be declared in the system
# dependencies template file (i.e. `home/.chezmoitemplates/archlinux/common-dependencies` in the case of Archlinux).
{{ includeTemplate "universal/profile-before" }}
{{ includeTemplate "universal/logg-before" }}
### Ensure Go is installed
if ! command -v go > /dev/null; then
if command -v brew; then
logg 'Installing go via Homebrew'
brew install go || GO_EXIT_CODE=$?
if [ -n "$GO_EXIT_CODE" ]; then
logg error 'go was not successfully installed via Homebrew'
fi
else
logg 'brew is unavailable. Cannot use it to perform a system installation of node.'
fi
else
logg 'go is available'
fi
### Ensure gh is installed
if ! command -v gh > /dev/null; then
if command -v brew; then
logg 'Installing gh via Homebrew'
brew install gh || GH_EXIT_CODE=$?
if [ -n "$GH_EXIT_CODE" ]; then
logg error 'gh was not successfully installed via Homebrew'
fi
else
logg 'brew is unavailable. Cannot use it to perform a system installation of node.'
fi
else
logg 'gh is available'
fi
### Ensure delta is installed
if ! command -v delta > /dev/null; then
if command -v brew; then
logg 'Installing delta via Homebrew'
brew install delta || DELTA_EXIT_CODE=$?
if [ -n "$DELTA_EXIT_CODE" ]; then
logg error 'delta was not successfully installed via Homebrew'
fi
else
logg 'brew is unavailable. Cannot use it to perform a system installation of node.'
fi
else
logg 'delta is available'
fi
{{ end -}}

View file

@ -1,28 +0,0 @@
{{- if (ne .host.distro.family "windows") -}}
#!/usr/bin/env bash
# @file GH (GitHub CLI) Install
# @brief Ensures GH (the GitHub CLI) is installed via Homebrew
# @description
# This script installs GH via Homebrew. GH is included as a dependency for
# generating the global git config helper since GH provides a credential
# helper that can be used to authenticate calls on `github.com`.
{{ includeTemplate "universal/profile-before" }}
{{ includeTemplate "universal/logg-before" }}
### Ensure gh is installed
if ! command -v gh > /dev/null; then
if command -v brew; then
logg 'Installing gh via Homebrew'
brew install gh || GH_EXIT_CODE=$?
if [ -n "$GH_EXIT_CODE" ]; then
logg error 'gh was not successfully installed via Homebrew'
fi
else
logg 'brew is unavailable. Cannot use it to perform a system installation of node.'
fi
else
logg 'gh is available'
fi
{{ end -}}

View file

@ -1,26 +0,0 @@
{{- if (ne .host.distro.family "windows") -}}
#!/usr/bin/env bash
# @file Go Install
# @brief Ensures Go is installed via Homebrew
# @description
# This script ensures Go is installed. It uses Homebrew to install Go.
{{ includeTemplate "universal/profile-before" }}
{{ includeTemplate "universal/logg-before" }}
### Ensure Go is installed
if ! command -v go > /dev/null; then
if command -v brew; then
logg 'Installing go via Homebrew'
brew install go || GO_EXIT_CODE=$?
if [ -n "$GO_EXIT_CODE" ]; then
logg error 'go was not successfully installed via Homebrew'
fi
else
logg 'brew is unavailable. Cannot use it to perform a system installation of node.'
fi
else
logg 'go is available'
fi
{{ end -}}

View file

@ -6,6 +6,7 @@
"expect"
"file"
"git"
"git-delta"
"gnome"
"go"
"hopenpgp-tools"

View file

@ -14,6 +14,7 @@ end
brew "age"
# Ensure macOS Bash gets upgraded to 5+
brew "bash"
brew "delta"
brew "gawk"
brew "glow"
brew "gnupg"

View file

@ -6163,7 +6163,7 @@ softwarePackages:
_bin: vdirsyncer
_github: https://github.com/pimutils/vdirsyncer
_name: vdirsyncer
_pre: echo "TODO - Implement the following command after automating the process of setting up contact groups / calendars to sync" && echo "vdirsyncer discover contacts" && echo "vdirsyncer sync contacts" && echo "TODO - Add to cron" && echo "*/30 * * * * /usr/local/bin/vdirsyncer sync > /dev/null" && echo "This should be in _post instead of _pre - it is here for testing purposes"
_todo: echo "TODO - Implement the following command after automating the process of setting up contact groups / calendars to sync" && echo "vdirsyncer discover contacts" && echo "vdirsyncer sync contacts" && echo "TODO - Add to cron" && echo "*/30 * * * * /usr/local/bin/vdirsyncer sync > /dev/null" && echo "This should be in _post instead of _pre - it is here for testing purposes"
pipx: vdirsyncer
charm:
_bin: charm