I've recently become a big fan of NixOS and its package manager Nix. It's been my daily driver on my workstation for about a quarter now, and although there's still a lot of question marks, I love it. And now I love it even more because I have finally managed to make nix-darwin work on my MacBook! Now I can finally get rid off the config drift I have because of differently formatted dotfiles and Homebew.
There's a lot of guides out there that will show you the setup, but to make it work with Home Manager, I had to fiddle around quite a bit. Have a look at my repository here to see if this gives you a hint in the right direction:
✨ https://github.com/bellackn/nixos-config ✨
Especially the configuration.nix and flake.nix files are important.
What I like about the structure that I have used is the fact that I can clone this repo on my Linux machine and on my MacBook, and
- run the same commands (described in the Justfile),
- share the same modules (for example my VSCode config),
- use the same package versions
– no matter which of my machines I'm using.
Enjoy!