News for hackers. Stuff that matters.
Re:macOS Sonoma is available today by mdaniel on Tuesday September 26, 2023 @06:34PM (#37666712)
I want to like Nix but those installation instructions for macOS (and their removal friend) are just crazypants as compared to the `sudo mkdir /nix && sudo chown $USER /nix` from the Linux version

And that's not even getting into the "waaa?" from `du -hs /nix` although I am open to that being a misleading dumber due to hardlinks and other trickery that du may not correctly surface

Re:macOS Sonoma is available today by yjftsjthsd-h on Tuesday September 26, 2023 @09:44PM (#37668711)
> And that's not even getting into the "waaa?" from `du -hs /nix` although I am open to that being a misleading number due to hardlinks and other trickery that du may not correctly surface

Are you running garbage collection? It gets out of hand if you keep all versions, but you don't need to do that

Re:macOS Sonoma is available today by faitswulff on Tuesday September 26, 2023 @10:22PM (#37669061)
The Determinate Systems nix installer is quite smooth: https://github.com/DeterminateSystems/nix-installer/

Though it does tend to get clobbered on macOS updates.

Re:macOS Sonoma is available today by iFreilicht on Wednesday September 27, 2023 @03:34AM (#37671360)
Yeah, that's a long-running and pretty much unfixable issue as macOS updates overwrite /etc/zshrc. AFAIK, the determinate systems installer does somewhat resolve this as you can just run it again and it will fix the issue.

The default installer is not idempotent yet (and my work on trying to resolve that has stalled, unfortunately, see https://github.com/NixOS/nix/pull/7603), so trying to run it again to fix this issue will result in errors.

Re:macOS Sonoma is available today by faitswulff on Wednesday September 27, 2023 @11:45AM (#37676389)
Yeah, I generally uninstall (with the remaining nix-installer binary on the nix volume) and then reinstall. It would be great if the installer were idempotent and I could just re-run the installer!
Re:macOS Sonoma is available today by abathur on Tuesday September 26, 2023 @11:01PM (#37669396)
Try running `sudo mkdir /nix && sudo chown $USER /nix` on modern macOS.
Re:macOS Sonoma is available today by 0x69420 on Tuesday September 26, 2023 @11:35PM (#37669701)
are we reading the same instructions? i struggle to see what makes a curlbash leading into a few interactive prompts “crazypants”; it's the same story with brew and gentoo prefix
Re:macOS Sonoma is available today by pxc on Wednesday September 27, 2023 @02:19AM (#37670868)
> And that's not even getting into the "waaa?" from `du -hs /nix` although I am open to that being a misleading number due to hardlinks and other trickery that du may not correctly surface

Nope, du counts hardlinks correctly when it encounters the same inode multiple times in the course of fulfilling a single invocation.

per https://ss64.com/osx/du.html :

> Files having multiple hard links are counted (and displayed) a single time per du execution.

Nix's disk usage profile is pretty similar to Flatpak's, or to a collection of closely related Docker containers. The difference between no Nix install and having one isn't huge. But your first installed Nix package will pull in very low level common dependencies— on Linux, everything between whatever application and the kernel (and on macOS, a bit less). Your next application will come with a smaller increase. Once you have a handful of programs installed, you no longer have big downloads for individual additions. When you have a lot installed, the difference isn't that huge, proportionally.

Over time, your Nixpkgs version will rotate and you can end up with deps from old versions of Nixpkgs, which can take up a lot of extra space. But that's easy enough to manage by pinning Nixpkgs.

If you ever uninstall programs, Homebrew's broken uninstallation functionality can very quickly make a Homebrew installation much (up to several times) larger than the equivalent Nix one once you have more than a handful of packages installed.