diff --git a/pills/08-generic-builders.xml b/pills/08-generic-builders.xml index 182d9a0..0a4061b 100644 --- a/pills/08-generic-builders.xml +++ b/pills/08-generic-builders.xml @@ -48,6 +48,12 @@ + Nix on darwin + The darwin (i.e. macOS) stdenv diverges from the Linux stdenv in several ways. A main difference is that the darwin stdenv relies upon clang rather than gcc as its C compiler. We can adapt this early example of how a stdenv works for darwin by using this modified version of hello.nix: + + + Please be aware that similar changes may be needed in what follows. + Now build it with nix-build hello.nix and you can diff --git a/pills/08/hello-nix-darwin.txt b/pills/08/hello-nix-darwin.txt new file mode 100644 index 0000000..b9f0d71 --- /dev/null +++ b/pills/08/hello-nix-darwin.txt @@ -0,0 +1,11 @@ +with (import {}); +derivation { + name = "hello"; + builder = "${bash}/bin/bash"; + args = [ ./hello_builder.sh ]; + inherit gnutar gzip gnumake coreutils gawk gnused gnugrep; + gcc = clang; + binutils_unwrapped = clang.bintools.bintools_bin; + src = ./hello-2.10.tar.gz; + system = builtins.currentSystem; +}