Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does `nix-darwin` provide?

Tags:

nix

I am new to nix world, and I use Mac OS X. I've just installed nix on my MacBook and want to use nix to manage some packages like Emacs instead of Homebrew.

I've found this repo: https://github.com/LnL7/nix-darwin , and I am curious:

What this repo provides for a Mac user?

Does it provide a way to manage OS X system itself? Or does it provide a way to manage softwares on OS X system?

What does the darwin-rebuild switch do to my system? Is that revertable?

like image 956
cmal Avatar asked Nov 16 '18 09:11

cmal


People also ask

What is nix build?

nix-build is essentially a wrapper around nix-instantiate (to translate a high-level Nix expression to a low-level store derivation) and nix-store --realise (to build the store derivation). Warning. The result of the build is automatically registered as a root of the Nix garbage collector.

What is Shell nix?

Description. The command nix-shell will build the dependencies of the specified derivation, but not the derivation itself. It will then start an interactive shell in which all environment variables defined by the derivation path have been set to their corresponding values, and the script $stdenv/setup has been sourced.


1 Answers

This page includes a nice overview of the different projects in the nix ecosystem https://nixos.wiki/wiki/Nix_Ecosystem, nix-darwin (kind of) takes the place of NixOS on macOS.

Nix (and nixpkgs) is all you need to install packages. What nix-darwin adds is configuration and service management using the same mechanism as NixOS and it's mostly intended for users that use or know NixOS and want to have some of the same features on a mac.

like image 107
LnL7 Avatar answered Oct 16 '22 23:10

LnL7