linuxify_formulas=( # GNU programs non-existing in macOS "watch" "wget" "wdiff --with-gettext" "gdb"
# GNU programs whose BSD counterpart is installed in macOS
"coreutils"
"binutils"
"diffutils"
"ed --with-default-names"
"findutils --with-default-names"
"gawk"
"gnu-indent --with-default-names"
"gnu-sed --with-default-names"
"gnu-tar --with-default-names"
"gnu-which --with-default-names"
"grep --with-default-names"
"gzip"
"screen"
# GNU programs existing in macOS which are outdated
"bash"
"emacs"
"gpatch"
"less"
"m4"
"make --with-default-names"
"nano"
"bison"
# BSD programs existing in macOS which are outdated
"flex"
# Other common/preferred programs in GNU/Linux distributions
"libressl"
"file-formula"
"git"
"openssh"
"perl"
"python"
"rsync"
"unzip"
"vim --override-system-vi"
)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).
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 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.
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.
That's more attributable to Apple than BSD.
In fairness, openssh is an OpenBSD project that gets ported everywhere else.
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.
https://github.com/danieldk/nix-home/blob/a7ddc5acf260552f73...
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.