-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
272 lines (247 loc) · 9.58 KB
/
flake.nix
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
{
description = "zmre nix cross-platform system configurations";
nixConfig = {
extra-substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
"https://zmre.cachix.org"
"https://yazi.cachix.org"
];
extra-trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"zmre.cachix.org-1:WIE1U2a16UyaUVr+Wind0JM6pEXBe43PQezdPKoDWLE="
"yazi.cachix.org-1:Dcdz63NZKfvUCbDGngQDAZq6kOroIrFoyO064uvLh8k="
];
};
inputs = {
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
## TODO: not sure if it matters, but probably worth threading -darwin version through on darwin builds
nixpkgs-stable-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # defaulting to unstable these days
flake-compat = {
# Needed along with default.nix in root to allow nixd lsp to do completions
# See: https://github.com/nix-community/nixd/tree/main/docs/examples/flake
url = "github:inclyc/flake-compat";
flake = false;
};
darwin.url = "github:lnl7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs-unstable";
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs-unstable";
# I use the nur repo for firefox extensions
nur.url = "github:nix-community/NUR";
pwnvim.url = "github:zmre/pwnvim";
pwneovide.url = "github:zmre/pwneovide";
# pwneovide.inputs.pwnvim.follows = "pwnvim";
ironhide.url = "github:IronCoreLabs/ironhide";
ironhide.inputs.nixpkgs.follows = "nixpkgs-unstable";
hackernews-tui.url = "github:aome510/hackernews-TUI";
hackernews-tui.flake = false;
# fenix needed to build hackernews with older rustc for now (2024-08-26)
# fenix = {
# url = "github:nix-community/fenix?ref=6c9f0709358f212766cff5ce79f6e8300ec1eb91";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# blocklist to add to hosts file -- stops ads and malware across apps
sbhosts.url = "github:StevenBlack/hosts";
# command line tool for gtm-hub
gtm-okr.url = "github:zmre/gtm-okr";
gtm-okr.inputs.nixpkgs.follows = "nixpkgs-unstable";
# twitter cli
babble-cli.url = "github:zmre/babble-cli";
babble-cli.inputs.nixpkgs.follows = "nixpkgs-unstable";
# devenv tool to simplify (?) project shells https://devenv.sh
devenv.url = "github:cachix/devenv/v0.5";
# Tool to make mac aliases without needing Finder scripting permissions for home-manager app linking
mkalias.url = "github:reckenrode/mkalias";
mkalias.inputs.nixpkgs.follows = "nixpkgs-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nps.url = "github:OleMussmann/Nix-Package-Search"; # use nps to quick search packages - requires gnugrep though
nps.inputs.nixpkgs.follows = "nixpkgs";
enola.url = "github:TheYahya/enola"; # sister to sherlock osint recon tool
enola.flake = false;
# VSCode extension built from github -- update version here and in ./modules/overlays.nix
kubernetes-yaml-formatter.url = "github:longkai/kubernetes-yaml-formatter/v1.1.0";
kubernetes-yaml-formatter.flake = false;
# github extensions not in nixpkgs (should periodically check that)
gh-worktree.url = "github:zmre/gh-worktree";
gh-worktree.inputs.nixpkgs.follows = "nixpkgs-unstable";
gh-feed.url = "github:rsteube/gh-feed";
gh-feed.flake = false;
yazi.url = "github:sxyazi/yazi";
yazi-quicklook.url = "github:vvatikiotis/quicklook.yazi";
yazi-quicklook.flake = false;
yazi-flavors.url = "github:yazi-rs/flavors";
yazi-flavors.flake = false;
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
nix-homebrew.inputs.nixpkgs.follows = "nixpkgs";
#nix-homebrew.inputs.brew-src.follows = "brew-src";
nix-homebrew.inputs.nix-darwin.follows = "darwin";
# Declarative, pinned homebrew tap management
homebrew-core.url = "github:homebrew/homebrew-core";
homebrew-core.flake = false;
homebrew-cask.url = "github:homebrew/homebrew-cask";
homebrew-cask.flake = false;
homebrew-bundle.url = "github:homebrew/homebrew-bundle";
homebrew-bundle.flake = false;
# homebrew-cask-fonts.url = "github:homebrew/homebrew-cask-fonts";
# homebrew-cask-fonts.flake = false;
homebrew-services.url = "github:homebrew/homebrew-services";
homebrew-services.flake = false;
homebrew-cask-drivers.url = "github:homebrew/homebrew-cask-drivers"; # for flipper zero
homebrew-cask-drivers.flake = false;
# homebrew-trippy.url = "github:fujiapple852/trippy"; # for trippy ping util
# homebrew-trippy.flake = false;
};
outputs = inputs @ {
self,
nixpkgs,
nixpkgs-stable,
nixpkgs-stable-darwin,
nixpkgs-unstable,
darwin,
home-manager,
sbhosts,
nixos-hardware,
nix-homebrew,
...
}: let
mkPkgs = system:
import nixpkgs {
inherit system;
inherit
(import ./modules/overlays.nix {
inherit inputs nixpkgs-unstable nixpkgs-stable nixpkgs-stable-darwin;
})
overlays
;
config = import ./config.nix;
};
mkHome = username: modules: {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "bak";
extraSpecialArgs = {inherit inputs username;};
users."${username}".imports = modules;
};
};
in {
darwinConfigurations = let
username = "pwalsh";
in {
attolia = darwin.lib.darwinSystem {
system = "aarch64-darwin";
pkgs = mkPkgs "aarch64-darwin";
specialArgs = {
inherit sbhosts inputs nixpkgs-stable nixpkgs-stable-darwin nixpkgs-unstable username;
};
modules = [
nix-homebrew.darwinModules.nix-homebrew # Make it so I can pin my homebrew taps and actually roll things back
{
nix-homebrew = {
# Install Homebrew under the default prefix
enable = true;
# Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2
enableRosetta = false;
# User owning the Homebrew prefix
user = username;
# Declarative tap management
taps = with inputs; {
"homebrew/homebrew-core" = homebrew-core;
"homebrew/homebrew-cask" = homebrew-cask;
# "homebrew/homebrew-cask-fonts" = homebrew-cask-fonts;
"homebrew/homebrew-bundle" = homebrew-bundle;
"homebrew/homebrew-services" = homebrew-services;
"homebrew/homebrew-cask-drivers" = homebrew-cask-drivers;
# "fujiapple852/trippy" = homebrew-trippy;
};
# With mutableTaps disabled, taps can no longer be added imperatively with `brew tap`.
mutableTaps = false;
# should only need this once...
autoMigrate = false;
};
}
./modules/darwin
home-manager.darwinModules.home-manager
(mkHome username [
./modules/home-manager
./modules/home-manager/home-darwin.nix
./modules/home-manager/home-security.nix
])
];
};
};
nixosConfigurations = let
username = "zmre";
in {
nixos = nixpkgs-unstable.lib.nixosSystem {
system = "aarch64-linux";
pkgs = mkPkgs "aarch64-linux";
specialArgs = {inherit inputs username;};
modules = [
home-manager.nixosModules.home-manager
./modules/hardware/parallels-arm.nix
{
networking.hostName = "nixos"; # Define your hostname.
}
./modules/nixos
#./modules/hardware/parallels.nix
sbhosts.nixosModule
{networking.stevenBlackHosts.enable = true;}
(mkHome username [
./modules/home-manager
./modules/home-manager/home-linux.nix
])
];
};
volantis = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
pkgs = mkPkgs "x86_64-linux";
specialArgs = {
inherit
sbhosts
inputs
nixpkgs
nixpkgs-stable
nixpkgs-unstable
username
;
};
modules = [
./modules/hardware/framework-volantis.nix
./modules/hardware/volantis.nix
nixos-hardware.nixosModules.framework-11th-gen-intel
./modules/nixos
sbhosts.nixosModule
{networking.stevenBlackHosts.enable = true;}
home-manager.nixosModules.home-manager
(mkHome username [
./modules/home-manager
./modules/home-manager/home-linux.nix
./modules/home-manager/home-security.nix
])
];
};
nixos-pw-vm = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
pkgs = mkPkgs "x86_64-linux";
specialArgs = {inherit inputs username;};
modules = [
home-manager.nixosModules.home-manager
./modules/nixos
./modules/hardware/parallels-hardware.nix
./modules/hardware/parallels.nix
sbhosts.nixosModule
{networking.stevenBlackHosts.enable = true;}
(mkHome username [
./modules/home-manager
./modules/home-manager/home-linux.nix
])
];
};
};
};
}