Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
240 lines (206 loc) · 6.27 KB
/
Copy pathflake.nix
File metadata and controls
240 lines (206 loc) · 6.27 KB
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
236
237
238
239
240
{
description = "Alexey's multi-machine configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
# Darwin support
nix-darwin = {
url = "github:LnL7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home Manager
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# Shared utilities
flake-parts.url = "github:hercules-ci/flake-parts";
# Secret management
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# macOS-specific
dock-module = {
url = "github:dustinlyons/nixos-config";
flake = false;
};
# Zed Editor preview builds
zed-editor-flake = {
url = "github:shekhirin/zed-editor-flake";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-parts.follows = "flake-parts";
};
};
# AeroSpace custom fork with tabs support
aerospace-flake = {
url = "github:shekhirin/AeroSpace/release";
inputs.nixpkgs.follows = "nixpkgs";
};
# LLM coding agents (daily updated)
llm-agents = {
url = "github:numtide/llm-agents.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Nanocode CLI
nanocode = {
url = "github:nanocodexyz/nanocode";
inputs.nixpkgs.follows = "nixpkgs";
};
# Official prebuilt Rex package (no stable release yet)
rex = {
url = "https://pkgs.superlogical.com/rex/nix/snapshot.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
# Rust Nix client; its classic mode stands in for nix, nix-build, ...
# Not following nixpkgs, so its builds come from cache.numtide.com.
iets.url = "github:numtide/iets";
asc = {
url = "github:rorkai/App-Store-Connect-CLI";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
boxctl-src = {
url = "git+ssh://git@github.com/tempoxyz/boxctl";
flake = false;
};
# pyrex, Pyramid threads as Rex tabs
pyrex = {
url = "git+ssh://git@github.com/tempoxyz/pyrex";
inputs.nixpkgs.follows = "nixpkgs";
};
# Remote macOS sudo approval via iPhone Face ID
sudo-faceid = {
url = "git+ssh://git@github.com/shekhirin/sudo-faceid";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{
self,
nixpkgs,
nix-darwin,
home-manager,
sops-nix,
dock-module,
zed-editor-flake,
aerospace-flake,
llm-agents,
...
}:
let
# System-specific package sets
darwinPkgs = import nixpkgs {
system = "aarch64-darwin";
overlays = [
(final: prev: {
inherit (zed-editor-flake.packages.aarch64-darwin) zed-editor-preview-bin;
inherit (aerospace-flake.packages.aarch64-darwin) aerospace;
})
];
config.allowUnfree = true;
};
boxPkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
in
{
# macOS configuration (personal)
darwinConfigurations.personal = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
pkgs = darwinPkgs;
specialArgs = { inherit inputs dock-module llm-agents; };
modules = [
./hosts/darwin/personal/default.nix
# Dock configuration
"${dock-module}/modules/darwin/dock"
# Home-Manager
home-manager.darwinModules.home-manager
# Remote Face ID sudo daemon
inputs.sudo-faceid.darwinModules.default
# Set system revision
{
system.configurationRevision = self.rev or self.dirtyRev or null;
}
];
};
# macOS configuration (work)
darwinConfigurations.work = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
pkgs = darwinPkgs;
specialArgs = { inherit inputs dock-module llm-agents; };
modules = [
./hosts/darwin/work/default.nix
# Dock configuration
"${dock-module}/modules/darwin/dock"
# Home-Manager
home-manager.darwinModules.home-manager
# Set system revision
{
system.configurationRevision = self.rev or self.dirtyRev or null;
}
];
};
# NixOS configuration for the box
nixosConfigurations.box = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
pkgs = boxPkgs;
specialArgs = { inherit inputs; };
modules = [
./hosts/nixos/default.nix
sops-nix.nixosModules.sops
# Pass inputs to Home Manager in NixOS as well
(_: {
home-manager.extraSpecialArgs = { inherit inputs; };
})
];
};
# Repository tools, without host overlays or private machine dependencies.
devShells.x86_64-linux.default =
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in
pkgs.mkShellNoCC {
packages = with pkgs; [
nix
inputs.iets.packages.x86_64-linux.default
jujutsu
just
nixfmt-tree
statix
shellcheck
];
};
# Formatters for each system
formatter = {
aarch64-darwin = darwinPkgs.nixfmt-tree;
x86_64-linux = (import nixpkgs { system = "x86_64-linux"; }).nixfmt-tree;
};
# Checks for each system
checks = {
aarch64-darwin = {
fmt = darwinPkgs.runCommand "fmt-check" { } ''
export HOME=$TMPDIR
${darwinPkgs.lib.getExe self.formatter.aarch64-darwin} --ci ${./.}
touch $out
'';
statix = darwinPkgs.runCommand "statix-check" { } ''
${darwinPkgs.lib.getExe darwinPkgs.statix} check ${./.}
touch $out
'';
};
x86_64-linux = {
fmt = boxPkgs.runCommand "fmt-check" { } ''
export HOME=$TMPDIR
${boxPkgs.lib.getExe self.formatter.x86_64-linux} --ci ${./.}
touch $out
'';
statix = boxPkgs.runCommand "statix-check" { } ''
${boxPkgs.lib.getExe boxPkgs.statix} check ${./.}
touch $out
'';
};
};
};
}