Compare commits

..

13 Commits

Author SHA1 Message Date
T. R. Bernstein
1e1ea39a90 Use HOME env variable in brew caller scripts 2025-10-20 14:02:31 +02:00
T. R. Bernstein
cd8f2b7c0d Fix missing function in setup-user script
Add missing getDefaultGitHomebrewURL.
2025-10-20 14:02:31 +02:00
T. R. Bernstein
48fe726f31 Make sudo-settings module executable 2025-10-20 14:02:31 +02:00
5d9b2d56e5 revert ea86be7b01
revert Use brew caller script without sudo
2025-10-18 23:27:06 +02:00
ea86be7b01 Use brew caller script without sudo 2025-10-18 23:22:59 +02:00
b7664ad8a7 Adapt UID of _homebrew depending on system version 2025-10-18 21:17:54 +02:00
37542773e3 Run homebrew as _homebrew user 2025-10-18 18:21:27 +02:00
7c8d81f080 Remove bun from installation 2025-10-18 18:08:42 +02:00
854c19f35f Use empty home variable for homebrew installation
Homebrew install script does not respect HOMEBREW_CACHE variable. Using an empty home variable ensures we get the result we want, but it is hacky.
2025-10-18 18:03:49 +02:00
87df4b6d7d Remove involuntary unicode char 2025-10-18 17:48:07 +02:00
8bca66a7bb Fix logical error regarding user id of _homebrew 2025-10-18 17:24:34 +02:00
T. R. Bernstein
8def65f683 Install f2 2025-10-18 15:40:16 +02:00
T. R. Bernstein
563a29aa58 Add Parallels to setup-host cmd 2025-10-18 15:30:36 +02:00
5 changed files with 26 additions and 14 deletions

View File

@@ -30,6 +30,7 @@ function main() {
installMASApp 'Numbers' 409203825
installMASApp 'Outbank' 1094255754
installMASApp 'Pages' 409201541
installMASApp 'Parallels Desktop' 1085114709
installMASApp 'Pixelmator Pro' 1289583905
installMASApp 'SnippetsLab' 1006087419
installMASApp 'Tim' 1449619230

View File

@@ -55,9 +55,17 @@ function downloadHomebrew() {
popd -q
}
function getCanonicalBrewPath() {
local brewPath=${homebrew_directory}/bin/brew
if [[ $brewPath == $HOME* ]]; then
brewPath="\${HOME}${brewPath#$HOME}"
fi
echo $brewPath
}
function createBrewCallerScript() {
local cmdPath=${HOME}/bin/brew
local brewPath=${homebrew_directory}/bin/brew
local brewPath=`getCanonicalBrewPath`
[[ -f ${cmdPath} ]] && rm ${cmdPath}
mkdir -p ${cmdPath:h}
cat <<- BREWCALLER > ${cmdPath}
@@ -74,13 +82,13 @@ function createBrewCallerScript() {
}
function createBrewPeriodicScript() {
local brewCallerPath=${HOME}/bin/brew
local brewPath=`getCanonicalBrewPath`
local cmdPath=${HOME}/bin/brew-periodic
[[ -f ${cmdPath} ]] && rm ${cmdPath}
mkdir -p ${cmdPath:h}
cat <<- BREWCALLER > ${cmdPath}
#!/usr/bin/env zsh
local brew='${brewCallerPath}'
local brew='${brewPath}'
\$brew update
\$brew upgrade --greedy
\$brew cleanup
@@ -138,6 +146,10 @@ function getHomebrewDirectoryPath() {
print -- ${homebrew_prefix:-$(getDefaultHomebrewPrefix)}/Homebrew
}
function getDefaultGitHomebrewURL() {
print -- ${HOMEBREW_BREW_GIT_REMOTE:-https://github.com/Homebrew/brew.git}
}
function configureFolders() {
local dirPath
for dirPath in ${HOME}/bin ${HOME}/.vim/{backups,swaps}; do

0
modules/00a-sudo-settings.sh Normal file → Executable file
View File

View File

@@ -42,12 +42,11 @@ function ensureUserCanNoLongerRunPasswordlessSudo() {
}
function getFirstFreeRoleAccountID() {
local minUserID=450
local maxUserID=499
local uname_machine=$(/usr/bin/uname -m)
if [[ ${uname_machine} == "arm64" ]]; then
minUserID=200
maxUserID=400
local minUserID=200
local maxUserID=400
if is-at-least 13.0 $(sw_vers -productVersion); then
minUserID=450
maxUserID=499
fi
dscl . -list '/Users' UniqueID | grep '_.*' | sort -n -k2 | awk -v i=${minUserID} '$2>='${minUserID}' && $2<'${maxUserID}' {if(i < $2) { print i; nextfile} else i=$2+1;} END {if(i <= '${maxUserID}' && ($2 < '${minUserID}' || $2 > '${maxUserID}')) print i;}'
}
@@ -207,9 +206,8 @@ function createBrewPeriodicScript() {
}
function installHomebrewCore() {
export NONINTERACTIVE=1
[ ! -d $(getHomebrewRepositoryPath) ] || return
sudo --preserve-env=NONINTERACTIVE -u "${homebrew_username}" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
[ ! -d $(getHomebrewRepositoryPath) ] || return
NONINTERACTIVE=1 HOME= sudo --preserve-env=NONINTERACTIVE,HOME -u "${homebrew_username}" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
[ -d $(getHomebrewRepositoryPath) ]
}
@@ -357,6 +355,7 @@ function getUsage() {
if [[ "${ZSH_EVAL_CONTEXT}" == toplevel ]]; then
test -f "${ASTZWEIG_MACOS_SYSTEM_LIB}" || { echo 'This module requires macos-system library. Please run again with macos-system library provieded as a path in ASTZWEIG_MACOS_SYSTEM_LIB env variable.'; return 10 }
autoload is-at-least
source "${ASTZWEIG_MACOS_SYSTEM_LIB}"
module_main $0 "$@"
fi

View File

@@ -4,7 +4,7 @@
function brewInstall() {
local identifier="$1"
local cask="${2:+--cask}"
indicateActivity -- "Installing ${identifier}${cask:+ (Cask)}" ${homebrew_path} install -q ${cask} ${identifier}
HOME=/Users/Shared indicateActivity -- "Installing ${identifier}${cask:+ (Cask)}" sudo -u _homebrew ${homebrew_path} install -q ${cask} ${identifier}
}
function installCask() {
@@ -59,7 +59,6 @@ function installBrews() {
lop -y body:h1 -- -i 'Installing Homebrew formulas'
installBrew mas
if ! isDebug; then
installBrew bun
installBrew chezmoi
installBrew cocogitto
installBrew composer
@@ -67,6 +66,7 @@ function installBrews() {
installBrew docker
installBrew docker-buildx
installBrew exiftool
installBrew f2
installBrew ffmpeg
installBrew gnupg
installBrew go