Live data from Hacker News

I Use Nix on macOS

blog.6nok.org

11–18 of 18 posts

Re: I Use Nix on macOS

#13

There exists nix-darwin, which allows for installing and configuring graphical apps on macOS. However, in my experience the OS starts freaking out about permissions every time you build --switch. Something about changing around the symlinks to .app files confuses it and resets permissions and duplicates autostart entries and such, which unfortunately got me to give up on it.

I'm a recent convert and set up nix-darwin and home-manager on a flake-based system, have not had any issues like this.

Re: I Use Nix on macOS

#14
post #6

> nix run nixpkgs#cowsay > This is a game-changer, you don’t have to pollute your system to run a one-off command, or you can try a package out before committing to installing it. Is there a way to run the command isolated from the rest of the system? Because while this is nice it will still leave behind whatever configuration files / caches the program created on start up.

Nothing nix specific but you may be interested in https://github.com/containers/bubblewrap

Re: I Use Nix on macOS

#16

it's interesting to me that the author didn't spend much time on home-manager or flakes. home-manager is apparently too complicated for OPs workflow which I could kinda see for simple things. But reproducibility is one of the strongest selling points of nix. So.. that being said, you can setup home-manager to install and configure things from git. Using flakes makes it more reproducible. These means that you can just…

I'm really interested in `home-manager` honestly, and while I agree about the benefits of declarative package management, I find it easier to type commands at a terminal like `nix profile upgrade pkg` or `nix registry pin nixpkgs`, with the guarantee of rollbacks.

Since when I'm editing a text file to update a package, I have to look for the latest version separately and copy/paste it into my editor. If I somehow mess it up the file is broken, while no harm is done I still find this workflow a bit brittle.

If there are home-manager commands I missed to do this, I'd be eager to give it a try. That kind of workflow would remind me of running `npm upgrade pkg` and have it reflected on a `package.json` file.

Re: I Use Nix on macOS

#17
post #8

I’ve beeen using Nix on macOS for years now, and I don’t imagine ever going back. Declarative software management is the future. So easy to keep my dev environment up-to-date and quickly try out new packages. Never breaks. Also, no more docker! docker on macOS was always a pain. I made it easy for others to try if you’re interested, almost 800 stars now: https://github.com/dustinlyons/nixos-config

This looks like a treasure trove that I somehow missed! I'll give it a more thorough read later, but gave my star for now, thanks!

Re: I Use Nix on macOS

#18
post #6

> nix run nixpkgs#cowsay > This is a game-changer, you don’t have to pollute your system to run a one-off command, or you can try a package out before committing to installing it. Is there a way to run the command isolated from the rest of the system? Because while this is nice it will still leave behind whatever configuration files / caches the program created on start up.

Nothing nix specific but you may be interested in https://github.com/containers/bubblewrap

Yeah I'm familiar, I was hoping for something more integrated, it seems like it would be a pretty good fit.
Post reply on HN