Skip to content

Commit

Permalink
changes to work with a homedir brew
Browse files Browse the repository at this point in the history
  • Loading branch information
tdeebswihart committed Apr 9, 2019
1 parent fd3e8e6 commit c342838
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 106 deletions.
56 changes: 11 additions & 45 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,20 @@
"railwaycat/emacsmacport"
],
"brew": [
"ansible",
"automake",
"awscli",
"bash",
"binwalk",
"cask",
"chezscheme",
"clojure",
"cmake",
"coreutils",
"curl",
"dep",
"direnv",
"emacs-mac",
"entr",
"fd",
"fzf",
"gawk",
"git",
"git-lfs",
"global",
"gnu-sed",
"gradle",
"httpie",
"ical-buddy",
"imagemagick",
"jam",
"jq",
Expand All @@ -38,35 +27,17 @@
"librsvg",
"libssh2",
"libxml2",
"mosh",
"neovim",
"nim",
"nmap",
"nnn",
"osquery",
"pandoc",
"parallel",
"pdfgrep",
"pkg-config",
"qrencode",
"qt",
"ripgrep",
"sdl_mixer",
"sdl_sound",
"shellcheck",
"smpeg",
"socat",
"stubby",
"swiftlint",
"tag",
"tailor",
"terminal-notifier",
"tesseract",
"texinfo",
"the_silver_searcher",
"tmux",
"unbound",
"unison",
"vim",
"watchman",
"wget",
Expand All @@ -78,39 +49,34 @@
],
"casks": [
"alfred",
"arq",
{"name": "arq", "when": "home"},
"bettertouchtool",
"brave-browser",
"dash",
{"name": "epic-games", "when": "home"},
"fantastical",
"firefox",
"font-fira-code",
"font-fira-mono",
"franz",
{"name": "franz", "when": "home"},
{"name": "gog-galaxy", "when": "home"},
"google-chrome",
"hammerspoon",
"iina",
"iridient-developer",
"java8",
"julia",
{"name": "iridient-developer", "when": "home"},
{"name": "java8", "when": "home"},
"keka",
"keybase",
{"name": "keybase", "when": "home"},
"lunchy",
"onyx",
{"name": "openemu", "when": "home"},
"osxfuse",
"popclip",
"r-app",
"racket",
"rstudio",
"signal",
{"name": "signal", "when": "home"},
"skim",
{"name": "steam", "when": "home"},
"tla-plus-toolbox",
"transmission",
{"name": "transmission", "when": "home"},
"virtualbox",
"vmware-fusion",
{"name": "vmware-fusion", "when": "home"},
"xquartz"
],
"mas": [
Expand Down Expand Up @@ -148,8 +114,8 @@
"config/*": "~/.config/",
"launchagents/*.plist":"~/Library/LaunchAgents/",
"hammerspoon/*": "~/.hammerspoon/",
"etc/unbound/*": "/usr/local/opt/unbound/etc/unbound/",
"etc/stubby/*": "/usr/local/etc/stubby/"
"etc/unbound/*": "~/homebrew/opt/unbound/etc/unbound/",
"etc/stubby/*": "~/homebrew/etc/stubby/"
},
"post-install": [
"brew cleanup",
Expand Down
8 changes: 4 additions & 4 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ def install_mas(apps, tags):


def check_install_deps_macos():
if not os.path.isdir("/usr/local/Cellar"):
print('Installing homebrew')
runcmd('/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"', stderr=STDOUT, shell=True)
if not os.path.isdir(os.path.expanduser("~/homebrew/Cellar")):
print('installing homebrew for the current user')
runcmd('mkdir ~/homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C ~/homebrew')
if not os.path.isfile('/usr/local/bin/mas'):
print('Installing mas')
runcmd('brew install mas')
Expand All @@ -188,7 +188,7 @@ def install_from_config(config_file, tags):
# FIXME: only do the following four on macos hosts
if platform.system() == 'Darwin':
check_install_deps_macos()
install_taps(config.get('brew-taps', []))
install_taps(config.get('taps', []))
install_brew(config.get('brew', []), tags)
install_casks(config.get('casks', []), tags)
install_mas(config.get('mas', []), tags)
Expand Down
12 changes: 6 additions & 6 deletions launchagents/local.timods.watchman.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<false/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/Cellar/watchman/4.9.0_2/libexec/bin/watchman</string>
<string>/Users/timods/homebrew/Cellar/watchman/4.9.0_2/libexec/bin/watchman</string>
<string>--foreground</string>
<string>--logfile=/usr/local/var/run/watchman/timods-state/log</string>
<string>--logfile=/Users/timods/homebrew/var/run/watchman/timods-state/log</string>
<string>--log-level=1</string>
<string>--sockname=/usr/local/var/run/watchman/timods-state/sock</string>
<string>--statefile=/usr/local/var/run/watchman/timods-state/state</string>
<string>--pidfile=/usr/local/var/run/watchman/timods-state/pid</string>
<string>--sockname=/Users/timods/homebrew/var/run/watchman/timods-state/sock</string>
<string>--statefile=/Users/timods/homebrew/var/run/watchman/timods-state/state</string>
<string>--pidfile=/Users/timods/homebrew/var/run/watchman/timods-state/pid</string>
</array>
<key>KeepAlive</key>
<dict>
Expand All @@ -26,7 +26,7 @@
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string><![CDATA[/Users/timods/.local/bin:/Users/timods/.cargo/bin:/opt/X11/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:]]></string>
<string><![CDATA[/Users/timods/.local/bin:/Users/timods/.cargo/bin:/opt/X11/bin:/Users/timods/homebrew/bin:/Users/timods/homebrew/sbin:/usr/bin:/bin:/usr/sbin:/sbin:]]></string>
</dict>
<key>ProcessType</key>
<string>Interactive</string>
Expand Down
23 changes: 0 additions & 23 deletions launchdaemons/local.timods.stubby.plist

This file was deleted.

25 changes: 0 additions & 25 deletions launchdaemons/local.timods.unbound.plist

This file was deleted.

4 changes: 2 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ python3 install.py config.json $* || (echo "Setup failed!" && exit 1)
test -f /tmp/casks && xargs </tmp/casks brew cask install
case $(uname -s) in
Darwin)
for plist in launchdaemons/*; do
for plist in launchdaemons/*.plist; do
daemon_path="/Library/LaunchDaemons/${plist#launchdaemons/}"
sudo cp "./${plist}" "$daemon_path"
quietly sudo launchctl stop "$daemon_path"
quietly sudo launchctl unload "$daemon_path"
sudo launchctl load "$daemon_path"
sudo launchctl start "$daemon_path" || echo "Error loading ${plist}!"
done
quietly test /usr/local/sbin/stubby-setdns-macos.sh && sudo /usr/local/sbin/stubby-setdns-macos.sh
# quietly which stubby-setdns-macos.sh && sudo stubby-setdns-macos.sh
;;
*) # Linux setup
;;
Expand Down
1 change: 1 addition & 0 deletions zsh/1.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Do nothing if not interactive
[ -z "$PS1" ] && return
PATH="$HOME/homebrew/sbin:$HOME/homebrew/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
2 changes: 1 addition & 1 deletion zsh/path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ case $(uname -s) in
;;
Darwin)
# since /usr/local is managed by homebrew (and it complains about "unmanaged" pkgs, I use $HOME/.local
BASEPATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:"
BASEPATH="$HOME/homebrew/sbin:$HOME/homebrew/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:"
BASEPATH=$(__maybe_append "$BASEPATH" "/opt/X11/bin" "/Library/TeX/texbin" "$HOME/macports/bin" "$HOME/Library/Python/3.7/bin")

if [ -z "$JAVA_HOME" -a -d /System/Library/Frameworks/JavaVM.framework/Home ]; then
Expand Down

0 comments on commit c342838

Please sign in to comment.