Manual: Converting Apple Silicon from Darwin
to Darwin-Nix
Introduction
This guide is designed to help you convert your Apple Silicon machine from
a standard Darwin setup to a Darwin-Nix configuration. This can be useful
for taking advantage of the Nix package manager’s unique features, such as
reproducible builds and a declarative configuration environment.
Prerequisites
• An Apple Silicon Mac running macOS.
• Administrative access to your machine.
• Basic knowledge of terminal usage and familiarity with the fish shell.
• Internet access for downloading necessary packages.
Step-by-Step Guide
Step 1: Install Nix
1. Open your terminal.
• You are using Fish shell version 4.0.2.
2. Run the Nix installation script:
curl -L [Link] | sh
3. Follow the on-screen instructions to complete the installation.
4. Source the Nix setup script for your shell session:
source /nix/var/nix/profiles/default/etc/profile.d/[Link]
Step 2: Modify Shell Configuration
1. Add Nix to your Fish shell configuration so it’s loaded automatically:
Edit your Fish configuration file (usually located at ~/.config/fish/[Link])
and add:
set -x PATH /nix/var/nix/profiles/default/bin $PATH
2. Reload your shell configuration to apply changes:
source ~/.config/fish/[Link]
Step 3: Verify the Installation
1. Check the Nix version:
1
nix-env --version
You should see an output displaying the installed version of Nix.
Step 4: Switch to Darwin-Nix
1. Configure NixOS-like environment:
Create a configuration for Nix to simulate a NixOS environment on Dar-
win. You may need to create or edit files under /etc/nixos (or a chosen
configuration directory).
2. Ensure proper architecture support:
Since you are on an Apple Silicon (ARM) machine, ensure relevant settings
in your configuration files support ARM architecture.
3. Install required Nix packages:
Use nix-env to install packages you need for your development or usage:
nix-env -iA nixpkgs.<package_name>
Conclusion
You’ve successfully converted your Apple Silicon setup from Darwin to a Nix-
managed system. You now have a powerful toolchain for managing packages
and configurations in a reproducible manner.
Troubleshooting
• Installation Errors: Check if all dependencies are met and the script
has permission to execute.
• Shell Path Issues: Verify the configuration changes in the fish config file
and that they are loaded correctly.
• Package Installation Issues: Ensure your configuration supports the
ARM architecture properly.
Additional Resources
• Nix Manual: Nix documentation
• Nix Packages: Nix Packages Collection
This concludes your guide on converting Apple Silicon from Darwin to Darwin-
Nix. Enjoy your new environment!