I hacked it together over a few hours and all of my original code has been completely replaced (and moved to its own repo, no less), but it's really cool to see people still using that feature.
Moreover, when things break, it's easy to fix. When things break on Mac, it's a black box. Trying to find help online is also equally frustrating. Getting help for linux issues is usually easy and informative, for example, forum posts and answers on stackoverflow-likes are detailed and generally explanatory, in which it seems like the intent is for both the askee and answerer are looking for "why" and not just "what". MacOS answers are always "copy and paste this" and half of them are obviously just plug and play or have bits that have accrued like gibberish extras in a game of telephone. Even blogposts are like this!
[0] I assume it's BSD-ish, but I wouldn't know because I've never used it. Moreover, openssh's tools act like this which catch me from time to time.
I still prefer gnu make though.
And why do you prefer GNU make specifically?
That's more attributable to Apple than BSD.
In fairness, openssh is an OpenBSD project that gets ported everywhere else.
The nice thing is that the system state is never mutated, you can just remove these lines from the configuration, run home-manager switch and you are back to the standard macOS userland.
You could also only use GNU userland in specific projects by putting a default.nix file in the project's directory and using dirvenv. cd to myproject and you have a GNU userland, cd out of myproject and you are back to the macOS userland.
I wouldn't use this script because I dislike installing so many packages that I don't need.
I’m specifically talking about (for example) overwriting /bin/ls with GNU ls. If someone simply prefers a GNU equivalent, they can trivially install GNU ls somewhere else on the system and use it all they want without blowing away part of the OS.
Imagine taking an Ubuntu box and overwriting every single core utility with a recompiled version of the utility of the same name from OpenBSD. You might think that’s a bad idea- same reasons, same risks. Sure, everything might work (and probably will), but it’s fundamentally destabilizing a working system.
And for what benefit? Just so some developer doesn’t have to be bothered with learning the differences between GNU and BSD runtimes? That just seems like a terrible tradeoff, and I wouldn’t want to work with someone who both didn’t know the difference and couldn’t be bothered to learn.
Like, if someone can’t be bothered to learn the OS that they’re working on, then there’s a simple solution: don’t use that OS. But if getting something done on that platform is a requirement, then they should take the time to do it properly, and beyond entry-level people I would simply expect any developer worth their salt to get their job done on the platform they’re developing for or deploying to. It’s not a lot to ask, it’s not a high bar, it’s a pretty reasonable expectation for a professional. People shouldn’t half-ass something like that just because they think they are too special or precious to spend time learning how to do their job.
EDIT: if it’s not obvious, I’m specifically talking about developing for a given platform in a professional capacity. I don’t care what people do for fun or education or hacking around- not unlike using a Hackintosh or jailbreaking a device. I don’t mean to sound judgy or anything (outside of a > entry level professional context).
That's exactly what this does. The script uses Homebrew, which installs all software into /usr/local - this is empty on a standard macOS install, and is not in PATH for regular Mac apps[1].
Homebrew also prefixes GNU tools by default so that you can use "ls" for BSD and "gls" for GNU, but this script disables that.
[1]: https://docs.brew.sh/FAQ#my-mac-apps-dont-find-usrlocalbin-utilities
I also have dotfiles that I keep synced between Linux and Mac systems. I don’t have anything super fancy, but in the cases where the platforms differ I’ve conditionalized those parts of the scripts/dotfiles/etc. on a per-platform basis.
My likely bias here is that I am fascinated by all of the little differences between platforms and rarely want to paper over them. Similarly, I can never bring myself to use a universal remote because there’s always something lost in translation vs. the remotes it replaces (also I may have a remote control collection problem).
I'm not interested nor have time to learn how all the differences between osx and linux, specially since installing the GNU utilities is good enough for 95% of tasks.
linuxify_formulas=( # GNU programs non-existing in macOS "watch" "wget" "wdiff --with-gettext" "gdb"
I use the default prefix and make sure the Homebrew stuff is in my $PATH before the built-in stuff and it works fine.
I switch between macOS and Linux on a daily basis. For me the benefit is in maintaining consistent dotfiles, scripts and workflow across macOS and Linux.
I was fully expecting comments on things breaking, and hopefully get something out of that discussion to improve the script (or maybe even deprecate it if it's demonstrably such a shitty idea).