TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: We open sourced our new Mac developer setup script

169 pointsby joelkeslerover 3 years ago

28 comments

xyzzy_plughover 3 years ago
I&#x27;m probably in the minority here but I would never run this if given the option. Most of the stuff in here has nothing to do with development as is just personal preference. Like what are you hoping to accomplish by dropping `ag` on my PATH? It&#x27;s just not a tool I use.<p>The stuff that&#x27;s specific to development -- go, node, npm, etc. -- sure that makes sense, but installing that stuff via brew is vastly inferior to versioning it as a dependency within your build system. And I&#x27;m not saying you have to use bazel or something. Pin your versions, install them by script <i>in the context of your build tools</i> and leave it at that.<p>I&#x27;d reckon the reason you don&#x27;t see this sort of thing often is because it&#x27;s not actually useful or necessary. I&#x27;d <i>rather</i> follow steps in a document somewhere so I can ignore the steps I don&#x27;t care about and share steps I find useful.<p>It&#x27;s like showing up to a job and them saying &quot;hey we&#x27;ve preconfigured emacs for you.&quot;<p>I&#x27;m a professional and take pride in knowing my tools. I can set up my development environment myself. I use Nix where possible and tend to avoid homebrew. Half of these things I have in my dotfiles or nix configs already, as do most of my peers.<p>I&#x27;m sure others will find this useful, and there&#x27;s certainly nothing harmful about this, but it&#x27;s certainly not for me, and I&#x27;m certain there&#x27;s a better way to go about handling all these things.
评论 #29536477 未加载
评论 #29538106 未加载
评论 #29537295 未加载
评论 #29537331 未加载
评论 #29536455 未加载
评论 #29536729 未加载
评论 #29536223 未加载
评论 #29538269 未加载
评论 #29536617 未加载
评论 #29536837 未加载
评论 #29536466 未加载
评论 #29536704 未加载
评论 #29536314 未加载
评论 #29538001 未加载
joelkeslerover 3 years ago
Author here:<p>This script helps new developers at my workplace setup their MacBook laptops quick, letting them hit the ground running.<p>Before this script, it could take 2-5 days to install and configure everything, as much of the knowledge needed was either scattered in old docs or passed down verbally from a few senior devs.<p>With this script, new developers can be ready in under 30 min.<p>I have tried to make this script simple and useful. You will want to customize the installation and configuration to match the tools and services you use at your company.<p>Note: it has not been tested on M1 Macs yet. I am still waiting on my M1 and will update when I receive it
评论 #29537992 未加载
评论 #29535614 未加载
评论 #29535611 未加载
oplavover 3 years ago
<p><pre><code> defaults write com.apple.finder ShowPathbar -bool true </code></pre> This is handy. I could never figure out how to reliably use a Finder window to navigate to a specific directory so I resorted to running &quot;open .&quot; from the directory in the terminal.
评论 #29536613 未加载
评论 #29536845 未加载
评论 #29537132 未加载
spywhereover 3 years ago
I did the same with my dotfiles setup, but it&#x27;s for my personal preferences.<p>Moreover, I think I have more options to skip particular part &#x2F; packages while also try to be idempotent as much as it can.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;spywhere&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;spywhere&#x2F;dotfiles</a>
评论 #29537643 未加载
评论 #29536296 未加载
setheronover 3 years ago
This script is a great pitch why Nix is the future.<p>Using these scripts as a way to give &quot;reproducible&quot; build environments is just doomed.
thatguydiditover 3 years ago
<a href="https:&#x2F;&#x2F;github.com&#x2F;geerlingguy&#x2F;mac-dev-playbook" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;geerlingguy&#x2F;mac-dev-playbook</a><p>a well loved and maintained ansible playbook for macs.<p>Just FYI
评论 #29537874 未加载
koirapoikaover 3 years ago
Here&#x27;s some feedback if it&#x27;s helpful for the author.<p>As mentioned in the comments, the script is supposed to cover fresh grads and Windows users with no prior Linux&#x2F;macOS experience.<p>The experienced users having their own opinion about the configuration would still require time to find and configure company-specific conventions and settings they&#x27;re not aware of. The common reaction is such opinionated scripts are avoided at any cost, so developers still spend time filtering the file(s) to find important bits. If the information is also in the documentation, it&#x27;s ok - the script can be safely ignored. Otherwise, it can be annoying and leave a bad impression.<p>For the next version, I&#x27;d try to make it friendlier for both groups of users. I&#x27;d say being able to revisit what exactly is to be installed would enable more people, save time and energy. The experts would only get necessary business settings integrated (via the advanced mode), while beginners would have complete installation (via the basic mode). It was a pretty common approach with TUI installers back in the day.<p>Homebrew-wise, I&#x27;d replace separate brew commands with a Brewfile and &#x27;brew bundle install&#x27;. It&#x27;d keep the package list isolated from the logic. Regarding the packages, I&#x27;d also put all version-sensitive software away from the direct Homebrew control. With programming languages, it&#x27;d be a version manager like &#x27;asdf&#x27; and so on.<p>I haven&#x27;t invested in a Nix configuration yet, since my small dotfiles repo works fine so far. There are obvious benefits, of course.
rcarmoover 3 years ago
As a long time brew and Mac user who keeps his Linux&#x2F;Mac environments in relative sync, I find these scripts fascinating, but would ultimately never, ever run anything like this, especially anything related to system-level tweaks.<p>That said, relying on brew to set up the language runtimes is a sane option. I just don&#x27;t think the script should go anywhere beyond that.
jonchurch_over 3 years ago
Can someone advise if the script is idempotent? That&#x27;s something I&#x27;ve never bothered with my own setup scripts, but really would be satisfying. Hoping to nerd snipe someone here =]
评论 #29536793 未加载
评论 #29536302 未加载
llimllibover 3 years ago
I keep a personal one that is somewhat simpler, and uses asdf for node, python, ruby etc: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;llimllib&#x2F;3fc4fefcfc0152dad8c58201246d8802" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;llimllib&#x2F;3fc4fefcfc0152dad8c58201246...</a><p>You might find it useful for a base for your own? up to you.
eastonover 3 years ago
2-5 days? I&#x27;m curious, is that because you don&#x27;t have anyone who has bandwidth to do ops (making end users manually do everything), or something else? Seems to me that most of this should just be installed via JAMF or your MDM of choice, so people can just take the laptop out of the box and be ready to rock once it syncs.<p>(Of course, the user will still have to get brew themselves most likely so the permissions are right, but everything else can be done on a system-wide level and be zero-touch for the end user.)<p>edit: Sorry if this sounded snarky, I didn&#x27;t intend it to be. Everyone has to allocate resources somehow. If you ever have time for a weekend project, I&#x27;d look up the cloud version of JAMF ($3 per device per month) or Intune (approximately the same if you have Microsoft services). Couple days of work and you&#x27;ll have a much easier end-user experience.
smoldesuover 3 years ago
It&#x27;s also not too hard to make your own, be it for MacOS or really any modern operating system. Just write down all of the changes you make on a fresh install, script out each line and you&#x27;re pretty much golden. It&#x27;s definitely a lifesaver when stepping onto a new machine.
评论 #29536132 未加载
W0lfover 3 years ago
I never understood the argument of _helping fellow developers out_ by setting up their development environment or _lowering the entrance bar_ as everything got so complicated really.<p>For one, I personally cannot trust the technical competence of a fellow developer if he&#x2F;she cannot handle their setup him&#x2F;herself. We&#x27;re talking installing tools by clicking around, aren&#x27;t we? The same argument holds true for a fellow plumber that has never worked with this pipe system in particular.<p>Second, there&#x27;s much to discover by installing and setting up everything by oneself. It can give insights on how things are connected to each other tool wise which is the first step of getting familiar with a new environment in the first place anyways.
评论 #29538552 未加载
评论 #29539556 未加载
评论 #29537972 未加载
评论 #29537877 未加载
zingarover 3 years ago
Nice work! I’ve used a similar script for Ruby dev (actually I use it as a reference rather than just running it, but still useful): <a href="https:&#x2F;&#x2F;github.com&#x2F;thoughtbot&#x2F;laptop" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;thoughtbot&#x2F;laptop</a><p>The oldest commits on this script are 11 years old and nothing in the last year, which seems quite stable. At the same time I was able to ask an intern to just run it last week, and bam! they have everything they need installed.<p>One use for it that surprised me was hearing a colleague saying that he reinstalls his OS after every change of client and runs the setup script again so there’s no fear of IP theft but also no downtime from having an unconfigured machine.
pkruminsover 3 years ago
I made something similar. Whenever I install a new workstation that runs Linux, I run this script:<p><a href="http:&#x2F;&#x2F;github.com&#x2F;pkrumins&#x2F;install-computer&#x2F;blob&#x2F;master&#x2F;install.sh" rel="nofollow">http:&#x2F;&#x2F;github.com&#x2F;pkrumins&#x2F;install-computer&#x2F;blob&#x2F;master&#x2F;inst...</a><p>This script installs all packages that I use, links all the dotfiles, all dockerfiles, all services, docker networks, setups all virtual hosts, and the new workstation is ready to use in 15 minutes. Before this script, it would take days to properly set a workstation up as I&#x27;d always forget something (missing file or configuration options).
rounakdattaover 3 years ago
I as well attempted to structure such tasks better with Ansible, <a href="https:&#x2F;&#x2F;github.com&#x2F;rounakdatta&#x2F;computer.setup" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rounakdatta&#x2F;computer.setup</a>. :)
jvolkmanover 3 years ago
At work we use a mixture of Bazel and Nix for our repo. Bazel drives everything, but Nix is used for its wide array of prebuilt third-party packages. Nix gives us e.g. python, postgres, clang, and various other utilities.<p>We have a mixture of python, java, go, protobuf, and node. The only tools a new developer needs to install are bazelisk and nix. Everything else is fetched as needed during build&#x2F;test.
评论 #29566115 未加载
don-codeover 3 years ago
Something I&#x27;ve not seen done, but to me seems like it would be much more useful than a shell script (or maybe would have, in these tools&#x27; heyday), would have been to use a tool like Chef or Ansible to manage dev dependencies on developer laptops.<p>The trouble with shell scripts is that they generally require you to manage the state of the machine - whether or not something is installed, before I go install and configure it. Or, if it&#x27;s already configured, what configs to leave in place, and what configs to reset.<p>With Chef, for instance, everything&#x27;s declarative. I don&#x27;t say &quot;install this package&quot;; rather, I say &quot;this package should be installed&quot;. Nobody ever runs the setup script just once, since the dev environment is constantly changing, and all of those edge cases (maybe I last ran it on rev 3, or rev 7 - how do I get to rev 12?) become hard to manage.
评论 #29536612 未加载
评论 #29536091 未加载
评论 #29536821 未加载
评论 #29536072 未加载
winridover 3 years ago
I&#x27;ve found that using ansible works pretty well for setting up dev machines.
ZeroGravitasover 3 years ago
The bits about Python caught my eye.<p>What is the current state of the art with python on Mac?<p>Python 2-&gt;3, brew vs core install and pyenv changes all seem to combine to make it a pain.<p>asdf as a generic &quot;use this version of language&#x2F;runtime in this directory&#x2F;project&quot; seems like it might be the future, but isn&#x27;t quite the norm now.<p>Anyone experienced with Python on Mac have any informed opinions to share?
评论 #29539646 未加载
dwelch2344over 3 years ago
Looks good. We’re publishing ours soon.<p>You should ditch nvm for Volta. It’s insanely better
评论 #29537760 未加载
评论 #29535930 未加载
评论 #29537763 未加载
评论 #29536447 未加载
评论 #29536983 未加载
oweilerover 3 years ago
I recommend using as few tools as possibly so that you don&#x27;t need such a script.
xodltusover 3 years ago
If I use this with a little modification, I think it will be useful to me
r-wover 3 years ago
This is fantastic!!! Also: no love for fish? ;)
评论 #29536493 未加载
errcorrectcodeover 3 years ago
Sorry, but configuration management supersedes setup scripts. This isn&#x27;t interesting.
meabedover 3 years ago
Nice - i learned few tricks from there. for the mac setup, I have been using this for years and works well for me. <a href="https:&#x2F;&#x2F;github.com&#x2F;geerlingguy&#x2F;mac-dev-playbook" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;geerlingguy&#x2F;mac-dev-playbook</a>
Uptrendaover 3 years ago
I find this completely boring and un-newsworthy.
pkulakover 3 years ago
Do you still have to wait for all 12 gigs of xcode to download and extract, then agrees to terms before you can use git?
评论 #29536259 未加载