How I use Nix to manage manage my MacBook

Published at Jul 2, 2025

Introduction

I have been using linux for the past 3-4 years. Half of that time has been spent using NixOS, which is a very popular operating system because of its declarability, immutability, and reproducability.

I switched to a MacBook because I started studying. In my case batterylife is something that I really benefit from. Other than that, the high quality design, beautiful display and good power is also very good.

Setup

Development Environments

Whenever I develop I utilize nix flakes. A flake is a config that you write in a directory which you can then activate manually or automatically such that it is run whenever you enter the directory. This means that whenever I enter my project directories my environment is configured by itself.

This is also very nice, because I do not have to reconfigure a new environment on another of my other machines. So if I want to work from my desktop, I enter the project directory like normally and then everything is set up.

This makes it really easy to be productive on multiple devices. An example of a flake could be something like the following:

{
  description = 'My Development Flake';

  inputs = {
    # Needed inputs e.g. nix packages
  }

  outputs = {
    # Desired outputs that can be used in the environment
  }

}