Hacker News new | ask | show | jobs
by firstSpeaker 1254 days ago
Could you elaborate what is preventing it from being the perfect backend dev laptop?
1 comments

I’m not the person you asked—but a ton of developer tooling just runs better on Linux. Installation is usually easier too—on a Mac, there’s Homebrew, but Homebrew doesn’t have the best user experience.

All the GUI productivity apps run better on a Mac—image editors, IDEs / text editors, apps like Slack or Zoom or whatever.

What specific developer tooling runs better on linux? If you're one of those Nix masochists I hear that runs on the Mac as well.
Fwiw you can use nix (the package manager) and the nixpkgs package repository without ever learning or writing a single line of nix (the language).

My introduction was to use nix instead of brew and ignore the whole "declarative configuration" aspect. It took me a while to get comfortable enough with that part of the ecosystem, but that's irrelevant to my point.

Give nix a try, use it like you'd use brew. Ignore the declarative configuration stuff for a bit.

What benefit would joining your cult bestow upon me that brew does not already?

My brew list is intentionally very short and my faffing about desire is limited.

Generally I use brew to pull in asdf (https://github.com/asdf-vm/asdf) to install programming languages/tooling, it works flawlessly.

I use Pipx (https://github.com/pypa/pipx) to install python thingies (such as yt-dlp) as a cli.

Go and Rust handle binaries in their languages beautifully and without issues.

If you're happy with brew, by all means continue using it. If asdf is getting you all the languages and tools you need without issue, by all means continue using it. My comment is just adding some details to the parent comment about nix running well on macOS.

EDIT: I doubt your question is in good faith considering the 'cult' comment, but to answer your question at face value regarding benefit the first one that comes to mind is being able to have multiple versions of the same package and being able to rollback to previous versions if something breaks. This also means you can have package A depend on package B v1, and package C depend on package B v2, and both can coexist. If this is not something that's valuable to you, that's fine too. The other killer feature is being able to install dependencies for a project/repository if it uses nix - just clone, cd, and run `nix develop` and you'll have all the dependencies available.

The cult comment was in jest. These are just package managers don't take things so seriously, it is all in good fun.

Yes, I understand the multiple versions of the same package thing - Go/Rust have package managers that quite reliably solve that problem. Pipx also to a certain extent solves that problem.

Brew is useful mostly for casks (browsers, mac apps, fonts) which don't usually call for multiple versions.

I'm sure it is a hairy problem for some combination of languages/tools but I guess I'm somehow completely side stepping it. Perhaps I'm more likely to encounter it if I treated my laptop as a server because that seems more like where Nix might shine as a sort of ansible/chef/puppet on steroids ;)

I am constantly fighting with Brew. If your brew list is short, congratulations, you’re free. I’m not free; there are too many packages I use.
If you're fighting with it something got b0rked along the way and you'll just keep having issues.

When you have some time might be worth it to start over. Don't use brew to install/manage your python, try it like how I wrote.

Can I just do “nix install foo”? I looked into nix ages ago but opening a text file any time I wanted to install some random package just felt too weird.
Yes! (kind of, I wish `nix install` was a thing)

    # search for a package called `foo`
    nix search nixpkgs foo
    # install package foo, user-wide
    nix-env -i foo
The CLI UX can get better, and I'm fairly sure folks are working on it.

You can also test-drive a package without committing to it, e.g. you want to try the program `cowsay` but only want to use it once:

    nix-shell -p cowsay
    cowsay
    exit
This spawns a new shell with `cowsay` available, and after you exit it won't be cluttering your system packages.