Compare commits
19 Commits
53b8527e12
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e1ea39a90 | ||
|
|
cd8f2b7c0d | ||
|
|
48fe726f31 | ||
| 5d9b2d56e5 | |||
| ea86be7b01 | |||
| b7664ad8a7 | |||
| 37542773e3 | |||
| 7c8d81f080 | |||
| 854c19f35f | |||
| 87df4b6d7d | |||
| 8bca66a7bb | |||
|
|
8def65f683 | ||
|
|
563a29aa58 | ||
|
|
0fbcf46307 | ||
|
|
59f627914d | ||
|
|
d4d03b0bb3 | ||
|
|
ad7007a8ee | ||
|
|
6cdd744093 | ||
|
|
604789d9a9 |
@@ -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
|
||||
|
||||
@@ -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
0
modules/00a-sudo-settings.sh
Normal file → Executable file
@@ -39,7 +39,7 @@ function configurePowerManagement() {
|
||||
${cmd} sleep 0
|
||||
${cmd} womp 0
|
||||
${cmd} acwake 0
|
||||
${cmd} proximitywake 0
|
||||
${cmd} proximitywake 1
|
||||
${cmd} destroyfvkeyonstandby 1
|
||||
pmset -b acwake 1
|
||||
${cmd} lidwake 1
|
||||
|
||||
@@ -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;}'
|
||||
}
|
||||
@@ -102,11 +101,14 @@ function getHomebrewRepositoryPath() {
|
||||
|
||||
function createBrewCallerScript() {
|
||||
ensureLocalBinFolder
|
||||
local uname_machine=$(/usr/bin/uname -m)
|
||||
local username=${homebrew_username}
|
||||
local homebrewRepositoryPath="$(getHomebrewRepositoryPath)"
|
||||
local brewCallerPath="${homebrewRepositoryPath}/bin/brew-caller"
|
||||
local brewCallerSymlink="/usr/local/bin/brew"
|
||||
[ -f "${brewCallerPath}" ] && rm "${brewCallerPath}"
|
||||
[[ -f "${brewCallerPath}" ]] && rm "${brewCallerPath}"
|
||||
[[ -f "${brewCallerSymlink}" || -h "${brewCallerSymlink}" ]] && rm "${brewCallerSymlink}"
|
||||
[[ ${uname_machine} == "arm64" ]] && brewCallerPath=${brewCallerSymlink}
|
||||
cat <<- BREWCALLER | clang -x c -O2 -Wall -o "${brewCallerPath}" -
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
@@ -152,11 +154,13 @@ function createBrewCallerScript() {
|
||||
target_gid = pw->pw_gid;
|
||||
|
||||
char *new_environ[] = {
|
||||
"PATH=" HOMEBREW_DIR "/usr/bin:/bin",
|
||||
"PATH=" HOMEBREW_DIR ":/usr/bin:/bin:/usr/sbin:/sbin",
|
||||
"HOMEBREW_CACHE=${homebrew_cache}",
|
||||
"HOMEBREW_LOGS=${homebrew_log}",
|
||||
format_env("HOME", "%s"),
|
||||
format_env("HOMEBREW_CASK_OPTS", "--no-quarantine %s"),
|
||||
"HOMEBREW_PREFIX=${homebrewRepositoryPath}",
|
||||
"HOMEBREW_CELLAR=${homebrewRepositoryPath}/Cellar",
|
||||
"HOMEBREW_NO_AUTO_UPDATE=1",
|
||||
"HOMEBREW_NO_ANALYTICS=1",
|
||||
"HOMEBREW_NO_ANALYTICS_THIS_RUN=1",
|
||||
@@ -183,7 +187,7 @@ function createBrewCallerScript() {
|
||||
BREWCALLER
|
||||
chown root:admin ${brewCallerPath}
|
||||
chmod 4550 ${brewCallerPath}
|
||||
ln -s "${brewCallerPath}" "${brewCallerSymlink}"
|
||||
[[ ${uname_machine} == "arm64" ]] || ln -s "${brewCallerPath}" "${brewCallerSymlink}"
|
||||
}
|
||||
|
||||
function createBrewPeriodicScript() {
|
||||
@@ -202,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) ]
|
||||
}
|
||||
|
||||
@@ -352,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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user