TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Package management on macOS with Nix-Darwin

64 pointsby photonbucketabout 1 year ago

7 comments

dlyonsabout 1 year ago
I’ve wrapped nix-darwin, home-manager etc in a Nix configuration for macOS, with a starter template and simple installer.<p>I’ve been running it for a couple years, you can use it to try Nix without as much up front learning.<p>Almost 1000 stars!<p><a href="https:&#x2F;&#x2F;github.com&#x2F;dustinlyons&#x2F;nixos-config">https:&#x2F;&#x2F;github.com&#x2F;dustinlyons&#x2F;nixos-config</a><p>Edit: Just crossed 1k! Thanks HN
davidpfarrellabout 1 year ago
(this prolly deserves its own blog post somewhere)<p>The most useful setup pattern I can share for both nix-darwin and home-manager is to configure them to store their rc files next to the system files, and not overwrite them ...<p>This keeps darwin&#x2F;hm from fully replacing your mac &#x2F;etc&#x2F;zsh* ~&#x2F;.zsh* files on each update and also keeps os system updates from destroying your nix files ...<p>You instead add sourcing statements in your system&#x2F;home files to bring in your nix files.<p>These sourcing statements are nuked after every OS upgrade so first time you login, nothing looks right in your shell.<p>For this, I keep a copy of both the system file before the nix sources and a copy of the file after the nix sources ... If the post-updated version of the system file matches the backup then I can simply replace with the backup of the versions with sources included ... If they don&#x27;t match, then I have to review the file, manually add the sources, and create new backups ...<p>I&#x27;ll also say that the system files haven&#x27;t changed in a long time (zsh) so I can just copy my etc&#x2F;zsh*-nix-backup files into place then restart my shell and be back to good ...
评论 #40159285 未加载
IfOnlyYouKnewabout 1 year ago
I have all the love and appreciation in the world for enjoying a weekend spent in configuration files. But I feel the need to state the obvious:<p>This is a long blog post ending with a preview to &quot;future installments of the guide&quot; to use nix, while almost everything that you need to know with homebrew is `brew install&#x2F;update&#x2F;upgrade&#x2F;uninstall`, and I have rarely run into any trouble with brew, and none at all in recent memory.
评论 #40159782 未加载
评论 #40159195 未加载
评论 #40159003 未加载
NewJazzabout 1 year ago
I tried setting up nix-darwin with home-manager, but it just made the system more confusing to operate. Ended up using home-manager standalone without flakes. Works like a charm.
评论 #40159504 未加载
评论 #40160455 未加载
dlachausseabout 1 year ago
That&#x27;s pretty cool that it can install Homebrew packages. Can anyone speak to how well that actually works in practice?
评论 #40158954 未加载
评论 #40158924 未加载
评论 #40159295 未加载
hazeboothabout 1 year ago
Without reading the article: I&#x27;ve used Nix on macOS without nix-darwin or home-manager for some time now. I define my packages in a flake.nix that exports an environment and I use install using `nix profile`.
评论 #40162180 未加载
dudusabout 1 year ago
I could never get into nix on Mac os. Maybe it&#x27;s a different thing if you use nixOS but I&#x27;m not willing to make that jump.<p>It seems the clear barrier to entry to nix is UX and to an extent the custom language they use. Maybe this problem can be solved with LLMs. We need an LLM fine tuned to write nix language.
评论 #40159779 未加载
评论 #40160434 未加载