
Show HN: Linuxify – Transform the MacOS CLI into a GNU/Linux CLI Experience - fabiomaia
https://github.com/fabiomaia/linuxify
======
danieldk
I use Nix[1] as my package manager on macOS with home-manager[2]. Since Nix
puts nix paths before OS paths and doesn't prefix GNU commands with 'g', I
just install _coreutils_ and others:

[https://github.com/danieldk/nix-
home/blob/a7ddc5acf260552f73...](https://github.com/danieldk/nix-
home/blob/a7ddc5acf260552f737700795252905ca64f4214/machines/macbook.nix#L20)

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.

[1] [https://nixos.org/nix/](https://nixos.org/nix/)

[2] [https://github.com/rycee/home-manager](https://github.com/rycee/home-
manager)

------
noobermin
One of the things I suppose I still couldn't get used to was just how BSD-
ish[0] tools differ from GNU tools. One of the things that drove me mad was
having forgotten a switch and having to move back to the beginning of the line
to add it again. Perhaps it was just me learning to be sloppy with GNU
userland but it was hard and it'd always be a fresh breath of air to use Linux
again.

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.

~~~
badrabbit
Everyone(new to bsd tools) is annoyed by that. This will get me many downvotes
but the BSD community embraces elitism,this is part of that "if you can't be
bothered to learn your shell's shortcuts to move to the desired position
immediately then you're not elite enough for bsd" or something on that line...

~~~
asveikau
I don't know if it's elitism, but I would say using *bsds over the years has
made me embrace minimalism a bit, and write shell scripts that make fewer
assumptions and work in more places. There is value in that, I think.

I still prefer gnu make though.

~~~
fabiomaia
I'm interested, can you elaborate on how your shell scripts now make fewer
assumptions?

And why do you prefer GNU make specifically?

------
joshuamcginnis
Alternatively, provide a Brewfile (`brew bundle dump`) and let users edit and
install (`brew bundle`) themselves.

~~~
dcreemer
thanks -- now I know about `brew bundle` and `mas`

~~~
ChristianBundy
Cool, people are still using Brewfiles!

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.

------
otherflavors
They lost me at " replacing pre-installed BSD programs..."

~~~
teilo
Very bad idea, and one that will cause a lot of breakage. There’s a reason
every package management system on Mac uses its own prefix.

~~~
sigfubar
What are you talking about? I've been using a similar homegrown setup for many
years and never had any issues. In fact, I've come to appreciate being able to
write directly on my Mac shell scripts destined to run on Linux boxen in
production.

~~~
fabiomaia
I had a similar goal I guess: make my dotfiles, scripts and workflow the same
across macOS and Linux. :)

------
mschuster91
@OP I'd suggest mentioning the Homebrew dependency or automatically using
macports if available. IIRC all the packages you install from brew are also
working in macports.

------
zuttton
For people to rich to afford just installing linux..

