The single source of truth for both Macs: every upstream input is pinned here, and darwinConfigurations is assembled per host from the same pinned set, so a given flake.lock evaluates to the same system every time.
Locked inputs
Read from flake.lock.
| Input | Source | Revision | Date |
|---|---|---|---|
| brew-src | github:Homebrew/brew/7.0.1 | b3625f7 | 2026-09-13 |
| home-manager | github:nix-community/home-manager | 5b76c5b | 2026-11-17 |
| homebrew-cask | github:homebrew/homebrew-cask | 0daa08a | 2026-11-17 |
| homebrew-core | github:homebrew/homebrew-core | 4a3a3ad | 2026-11-17 |
| homebrew-orca | github:stablyai/homebrew-orca | 543d334 | 2026-11-16 |
| homebrew-productdevbook | github:productdevbook/homebrew-tap | 69a06a4 | 2026-11-12 |
| llm-agents | github:numtide/llm-agents.nix | 06373ad | 2026-11-17 |
| mcp-servers-nix | github:natsukium/mcp-servers-nix | 47945d9 | 2026-11-11 |
| nix-darwin | github:nix-darwin/nix-darwin | ff0e21a | 2026-10-31 |
| nix-homebrew | github:zhaofengli/nix-homebrew | 52bc87d | 2026-11-01 |
| nixpkgs | github:NixOS/nixpkgs/nixpkgs-unstable | 1c872b8 | 2026-11-15 |
| skill-skill-skill | github:naitokosuke/skill-skill-skill | fdfab34 | 2026-09-04 |
| treefmt-nix | github:numtide/treefmt-nix | 0d6d739 | 2026-10-13 |
| vscode-settings | github:naitokosuke/vscode-settings | a050ac5 | 2026-11-17 |
Inputs
Inputs that depend on nixpkgs follow this one, so everything ships one package set. The flake = false inputs are locked source snapshots read at eval time: Homebrew itself and its taps, the VS Code settings and the Claude Code skills. llm-agents supplies Claude Code and mcp-servers-nix the MCP module.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71 inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:nix-darwin/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
nix-homebrew.inputs.brew-src.follows = "brew-src";
# Homebrew itself, pinned ahead of nix-homebrew's own brew-src (issue #432).
brew-src = {
url = "github:Homebrew/brew/7.0.1";
flake = false;
};
# brew bundle unconditionally loads the core tap when
# HOMEBREW_NO_INSTALL_FROM_API is set, so it must be pinned even though
# no formulae are installed via Homebrew.
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
homebrew-productdevbook = {
url = "github:productdevbook/homebrew-tap";
flake = false;
};
homebrew-orca = {
url = "github:stablyai/homebrew-orca";
flake = false;
};
vscode-settings.url = "github:naitokosuke/vscode-settings";
vscode-settings.flake = false;
skill-skill-skill = {
url = "github:naitokosuke/skill-skill-skill";
flake = false;
};
llm-agents.url = "github:numtide/llm-agents.nix";
llm-agents.inputs.nixpkgs.follows = "nixpkgs";
llm-agents.inputs.treefmt-nix.follows = "treefmt-nix";
mcp-servers-nix.url = "github:natsukium/mcp-servers-nix";
mcp-servers-nix.inputs.nixpkgs.follows = "nixpkgs";
};Overlays
The custom packages sit under pkgs.naitokosuke rather than at the top level, so one can never shadow a nixpkgs attribute of the same name (#545). The same set is the flake's packages output, so nix build .#frog works standalone.
106
107
108
109 overlays = [
(final: _: { naitokosuke = customPackages final; })
llm-agents.overlays.shared-nixpkgs
];One nixpkgs instance
Imported once, with the overlays and the nixpkgs config, and used by everything: the hosts take it through nixpkgs.pkgs and the flake's own outputs are built from it (#554). A custom package therefore builds the same way through nix build .#<pkg> as through darwin-rebuild switch.
117
118
119
120
121 pkgs = import nixpkgs {
localSystem = system;
config = nixpkgsConfig;
inherit overlays;
};mkDarwinConfig
One darwinSystem per host. specialArgs hands the flake inputs to every module, and the inline module gives each host the pkgs above through nixpkgs.pkgs, with system.primaryUser read from config.naitokosuke.username. ./modules/naitokosuke loads first, then the home-manager and nix-homebrew modules, hosts/common and hosts/<hostName>. Adding a Mac is one entry in hosts plus a hosts/<host>/default.nix.
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159 mkDarwinConfig =
hostName:
nix-darwin.lib.darwinSystem {
specialArgs = {
inherit inputs;
};
modules = [
./modules/naitokosuke
(
{ config, ... }:
{
networking.hostName = hostName;
networking.computerName = hostName;
system.primaryUser = config.naitokosuke.username;
nixpkgs.pkgs = pkgs;
}
)
home-manager.darwinModules.home-manager
nix-homebrew.darwinModules.nix-homebrew
./hosts/common
./hosts/${hostName}
];
};
darwinConfigurations = nixpkgs.lib.genAttrs hosts mkDarwinConfig;Formatter
nix fmt runs nixfmt through treefmt-nix, with flake.nix marking the project root.
164
165
166
167
168
169 treefmtEval = treefmt-nix.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
# Generated by nvfetcher, and not always the way nixfmt would write it.
settings.global.excludes = [ "pkgs/_sources/*" ];
};Docs data
The facts the walkthrough site in docs/ shows (casks, package versions, enabled programs, locked inputs, options), evaluated rather than restated in prose (#612). The site reads it as JSON: nix eval --json .#docsData
183
184
185
186
187
188 docsData = import ./docs/facts.nix {
inherit (nixpkgs) lib;
inherit darwinConfigurations;
inherit (inputs) self;
packages = inputs.self.packages.${system};
};Checks
nix flake check on its own only notices that darwinConfigurations exists, so the hosts and the custom packages are listed here to be built, along with the formatting check, the deletion guard's bun test suite, and a check that the JSON tool AGENTS.md rules out has not come back. The check workflow runs this on every pull request, and the nvfetcher workflow before proposing a bump.
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232 checks.${system} =
nixpkgs.lib.mapAttrs' (
name: host: nixpkgs.lib.nameValuePair "host-${name}" host.config.system.build.toplevel
) darwinConfigurations
// nixpkgs.lib.mapAttrs' (
name: nixpkgs.lib.nameValuePair "package-${name}"
) inputs.self.packages.${system}
// {
formatting = treefmtEval.config.build.check inputs.self;
claude-rm-guard =
pkgs.runCommand "claude-rm-guard-test"
{
nativeBuildInputs = [
pkgs.bun
pkgs.shfmt
];
}
''
cd ${./home/claude-rm-guard}
HOME=$TMPDIR bun test
touch $out
'';
# See AGENTS.md. The pattern is spelled so this file does not match
# itself.
no-json-query-tool =
pkgs.runCommand "no-json-query-tool" { nativeBuildInputs = [ pkgs.ripgrep ]; }
''
if rg --hidden --line-number --glob '!AGENTS.md' '\bj[q]\b' ${inputs.self}; then
echo "This repository does not use the tool named above; see AGENTS.md." >&2
exit 1
fi
touch $out
'';
};View the complete file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235# The single source of truth for both Macs: every upstream input is pinned
# here, and `darwinConfigurations` is assembled per host from the same pinned
# set, so a given flake.lock evaluates to the same system every time.
{
description = "naito's nix-darwin system flake";
## Inputs
# Inputs that depend on nixpkgs `follow` this one, so everything ships one
# package set. The `flake = false` inputs are locked source snapshots read
# at eval time: Homebrew itself and its taps, the VS Code settings and the
# Claude Code skills. `llm-agents` supplies Claude Code and `mcp-servers-nix`
# the MCP module.
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:nix-darwin/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
nix-homebrew.inputs.brew-src.follows = "brew-src";
# Homebrew itself, pinned ahead of nix-homebrew's own brew-src (issue #432).
brew-src = {
url = "github:Homebrew/brew/7.0.1";
flake = false;
};
# brew bundle unconditionally loads the core tap when
# HOMEBREW_NO_INSTALL_FROM_API is set, so it must be pinned even though
# no formulae are installed via Homebrew.
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
homebrew-productdevbook = {
url = "github:productdevbook/homebrew-tap";
flake = false;
};
homebrew-orca = {
url = "github:stablyai/homebrew-orca";
flake = false;
};
vscode-settings.url = "github:naitokosuke/vscode-settings";
vscode-settings.flake = false;
skill-skill-skill = {
url = "github:naitokosuke/skill-skill-skill";
flake = false;
};
llm-agents.url = "github:numtide/llm-agents.nix";
llm-agents.inputs.nixpkgs.follows = "nixpkgs";
llm-agents.inputs.treefmt-nix.follows = "treefmt-nix";
mcp-servers-nix.url = "github:natsukium/mcp-servers-nix";
mcp-servers-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs@{
nixpkgs,
nix-darwin,
home-manager,
treefmt-nix,
nix-homebrew,
llm-agents,
...
}:
let
system = "aarch64-darwin";
# The single entry into ./pkgs, used by both the overlay and the
# `packages` output below.
customPackages = final: import ./pkgs { pkgs = final; };
nixpkgsConfig = {
# Named one by one, so a new unfree dependency fails evaluation instead
# of slipping in.
allowUnfreePredicate =
pkg:
builtins.elem (nixpkgs.lib.getName pkg) [
"input-fonts"
];
input-fonts.acceptLicense = true;
};
## Overlays
# The custom packages sit under `pkgs.naitokosuke` rather than at the top
# level, so one can never shadow a nixpkgs attribute of the same name
# (#545). The same set is the flake's `packages` output, so
# `nix build .#frog` works standalone.
overlays = [
(final: _: { naitokosuke = customPackages final; })
llm-agents.overlays.shared-nixpkgs
];
## One nixpkgs instance
# Imported once, with the overlays and the nixpkgs config, and used by
# everything: the hosts take it through `nixpkgs.pkgs` and the flake's
# own outputs are built from it (#554). A custom package therefore builds
# the same way through `nix build .#<pkg>` as through
# `darwin-rebuild switch`.
pkgs = import nixpkgs {
localSystem = system;
config = nixpkgsConfig;
inherit overlays;
};
hosts = [
"Mac-big"
"Macbook-heavy"
];
## mkDarwinConfig
# One `darwinSystem` per host. `specialArgs` hands the flake `inputs` to
# every module, and the inline module gives each host the `pkgs` above
# through `nixpkgs.pkgs`, with `system.primaryUser` read from
# `config.naitokosuke.username`. `./modules/naitokosuke` loads first,
# then the home-manager and nix-homebrew modules, `hosts/common` and
# `hosts/<hostName>`. Adding a Mac is one entry in `hosts` plus a
# `hosts/<host>/default.nix`.
mkDarwinConfig =
hostName:
nix-darwin.lib.darwinSystem {
specialArgs = {
inherit inputs;
};
modules = [
./modules/naitokosuke
(
{ config, ... }:
{
networking.hostName = hostName;
networking.computerName = hostName;
system.primaryUser = config.naitokosuke.username;
nixpkgs.pkgs = pkgs;
}
)
home-manager.darwinModules.home-manager
nix-homebrew.darwinModules.nix-homebrew
./hosts/common
./hosts/${hostName}
];
};
darwinConfigurations = nixpkgs.lib.genAttrs hosts mkDarwinConfig;
## Formatter
# `nix fmt` runs nixfmt through treefmt-nix, with flake.nix marking the
# project root.
treefmtEval = treefmt-nix.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
# Generated by nvfetcher, and not always the way nixfmt would write it.
settings.global.excludes = [ "pkgs/_sources/*" ];
};
in
{
inherit darwinConfigurations;
packages.${system} = customPackages pkgs;
formatter.${system} = treefmtEval.config.build.wrapper;
## Docs data
# The facts the walkthrough site in docs/ shows (casks, package versions,
# enabled programs, locked inputs, options), evaluated rather than
# restated in prose (#612). The site reads it as JSON:
# nix eval --json .#docsData
docsData = import ./docs/facts.nix {
inherit (nixpkgs) lib;
inherit darwinConfigurations;
inherit (inputs) self;
packages = inputs.self.packages.${system};
};
## Checks
# `nix flake check` on its own only notices that `darwinConfigurations`
# exists, so the hosts and the custom packages are listed here to be
# built, along with the formatting check, the deletion guard's `bun test`
# suite, and a check that the JSON tool AGENTS.md rules out has not come
# back. The check workflow runs this on every pull request, and the
# nvfetcher workflow before proposing a bump.
checks.${system} =
nixpkgs.lib.mapAttrs' (
name: host: nixpkgs.lib.nameValuePair "host-${name}" host.config.system.build.toplevel
) darwinConfigurations
// nixpkgs.lib.mapAttrs' (
name: nixpkgs.lib.nameValuePair "package-${name}"
) inputs.self.packages.${system}
// {
formatting = treefmtEval.config.build.check inputs.self;
claude-rm-guard =
pkgs.runCommand "claude-rm-guard-test"
{
nativeBuildInputs = [
pkgs.bun
pkgs.shfmt
];
}
''
cd ${./home/claude-rm-guard}
HOME=$TMPDIR bun test
touch $out
'';
# See AGENTS.md. The pattern is spelled so this file does not match
# itself.
no-json-query-tool =
pkgs.runCommand "no-json-query-tool" { nativeBuildInputs = [ pkgs.ripgrep ]; }
''
if rg --hidden --line-number --glob '!AGENTS.md' '\bj[q]\b' ${inputs.self}; then
echo "This repository does not use the tool named above; see AGENTS.md." >&2
exit 1
fi
touch $out
'';
};
};
}