Skip to content

Make infrastructure darwin install#95

Merged
designbyajay merged 10 commits into
mainfrom
make-infrastructure-darwin-install
Jul 20, 2026
Merged

Make infrastructure darwin install#95
designbyajay merged 10 commits into
mainfrom
make-infrastructure-darwin-install

Conversation

@designbyajay

Copy link
Copy Markdown
Member

create the infrastructure project, and add helper scripts for setting up a MacOS machine with NixOS

This PR contains the bare minimum needed to set up and test a nix-darwin installation. Future commits will add configuration for

users' home directories, applications, login items or launch agents
NixOS physical machines
physical networks
This PR demonstrates nix flake best practices. The flake exposes

modules containing Darwin configurations in infrastructure/macos/system
a template, which imports the modules and wraps them in a Darwin configuration
an #install package, which automatically copies the template, swaps in machine-specific variables, and applies the nix-darwin configuration to the MacOS machine. Try running sudo -H nix run "github:incremental-design/projects?dir=infrastructure -- --help
Why flakes?

Flakes standardize the contents of nix expressions. Without flakes, you have to read the source to find out what's in a .nix file. Flakes make it possible to nix flake show "github:incremental-design/projects?dir=infrastructure" to see the flake contents, or nix flake check "github:incremental-design/projects?dir=infrastructure

Why not flake parts?

Nix flakes already consume modules and arbitrary expressions. While flake parts is interesting, I wasn't able to get it to work with nix-darwin modules and configuration in a reasonable amount of time. I'm also skeptical of the value of flake-parts when I can use flake-schemas for a similar purpose. I may change my mind later.

remove unused flake-utils

Signed-off-by: Ajay Ganapathy <ajay@incremental.design>
project-lint --all for .nix files did not catch all .nix files in PWD
because of a typo

Signed-off-by: Ajay Ganapathy <ajay@incremental.design>
Signed-off-by: Ajay Ganapathy <ajay@incremental.design>
Signed-off-by: Ajay Ganapathy <ajay@incremental.design>
Signed-off-by: Ajay Ganapathy <ajay@incremental.design>
Signed-off-by: Ajay Ganapathy <ajay@incremental.design>
Signed-off-by: Ajay Ganapathy <ajay@incremental.design>
this template can be copied into /var/root and modified before running
darwin-rebuild -- switch to install the darwin configuration

this template references the darwin modules from
infrastructure/flake.nix and includes them in a full darwin
configuration

Signed-off-by: Ajay Ganapathy <ajay@incremental.design>
script usage on macOS:

sudo -H nix run incremental-design/projects?dir=infrastructure#install
-- --help

for options

Signed-off-by: Ajay Ganapathy <ajay@incremental.design>
Signed-off-by: Ajay Ganapathy <ajay@incremental.design>
@designbyajay
designbyajay merged commit 825f9ec into main Jul 20, 2026
13 checks passed
@designbyajay
designbyajay deleted the make-infrastructure-darwin-install branch July 20, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant