Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Perhaps what is missing is the book "Nix - The good parts". Not saying Nix is not good overall, but getting a condensed description what is worth knowing, leaving out what can be ignored or is obsolete, would be quite valuable.


Here you go:

- don't use nix-env ever

- enable and use the new nix command (nix3)

- enable and use flakes

- use home-manager

- if on macOS, use nix-darwin

- with flakes, freely use nixpkgs unstable (stable is still useful, but flakes provide their own stability through pinned versions).


I’m looking at nix-darwin but there is no explanation on what it actually does

https://github.com/LnL7/nix-darwin


It's like a system-wide home-manager alternative for Darwin systems. Or the other way - a NixOS-like whole system management that works on top of Darwin.

For some examples: you can manage your homebrew packages, set keyboard preferences, trackpad settings, updates, finder defaults, etc through the nix config.


As a NixOS user, this sounds awesome! Thank you


Check out its manual to discover all of the configuration options you can set.

https://daiderd.com/nix-darwin/manual/index.html#sec-options


And you do this to install MySQL?


That argument can be weaponized against anything and everything, really.

"Oh, Ubuntu is too complicated"

"It's easy. 1. Don't use dpkg, ever. 2. Use the apt command. 3. Avoid Snaps. 4. Well, forget about locking dependencies, this isn't Nix. 5. No Home Manager equivalent exists, so I don't know, use Ansible? 6. If on macOS, you're out of luck. 7. Make sure to download the latest release."

"And you do this to install MySQL?"


It’s a lot of upfront work sure, but afterward installing any package (including MySQL) is just appending the package name to a list in your config file. The powerful part is that uninstalling the package is as simple as deleting it from that list.

Or if you don’t want to install the package permanently and just want it for a one-off job, `nix-shell -p mysql` starts a shell with mysql on your path, which will disappear as soon as you exit the shell.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: