1{
2 nixConfig = {
3 experimental-features = "nix-command flakes";
4 substitute = "true";
5 extra-substituters = [
6 "https://cache.nixos.org"
7 "https://crane.cachix.org"
8 "https://isabelroses.cachix.org"
9 "https://nix-community.cachix.org"
10 "https://nixpkgs-wayland.cachix.org"
11 "https://viperml.cachix.org"
12 ];
13 trusted-public-keys = [
14 "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
15 "crane.cachix.org-1:8Scfpmn9w+hGdXH/Q9tTLiYAE/2dnJYRJP7kl80GuRk="
16 "isabelroses.cachix.org-1:mXdV/CMcPDaiTmkQ7/4+MzChpOe6Cb97njKmBQQmLPM="
17 "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
18 "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
19 "viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8="
20 ];
21 cores = 0;
22 max-jobs = 2;
23 netrc-file = "/home/thehedgehog/.netrc";
24 };
25 description = "PyroNet machines and services";
26
27 inputs = {
28 snowfall-lib = {
29 url = "github:snowfallorg/lib";
30 inputs.nixpkgs.follows = "nixpkgs";
31 inputs.flake-compat.follows = "flake-compat";
32 };
33 nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
34 stable.url = "github:nixos/nixpkgs/nixos-24.05";
35 # Overrides
36 flake-compat.url = "github:edolstra/flake-compat";
37 systems.url = "github:nix-systems/default";
38 flake-parts = {
39 url = "github:hercules-ci/flake-parts";
40 inputs.nixpkgs-lib.follows = "nixpkgs-lib";
41 };
42 flake-utils = {
43 url = "github:numtide/flake-utils";
44 inputs.systems.follows = "systems";
45 };
46 nixpkgs-lib.url = "github:nix-community/nixpkgs.lib";
47
48 # Inputs
49 agenix = {
50 url = "github:ryantm/agenix";
51 inputs = {
52 nixpkgs.follows = "nixpkgs";
53 systems.follows = "systems";
54 home-manager.follows = "home-manager";
55 };
56 };
57 authentik = {
58 url = "github:nix-community/authentik-nix";
59 inputs = {
60 flake-utils.follows = "flake-utils";
61 flake-parts.follows = "flake-parts";
62 flake-compat.follows = "flake-compat";
63 nixpkgs.follows = "nixpkgs";
64 };
65 };
66 buildbot-nix = {
67 url = "github:Mic92/buildbot-nix";
68 inputs.nixpkgs.follows = "nixpkgs";
69 inputs.flake-parts.follows = "flake-parts";
70 };
71 ctp = {
72 url = "github:catppuccin/nix";
73 };
74 deploy-rs = {
75 url = "github:serokell/deploy-rs";
76 inputs = {
77 nixpkgs.follows = "nixpkgs";
78 utils.follows = "flake-utils";
79 flake-compat.follows = "flake-compat";
80 };
81 };
82 dns = {
83 url = "github:nix-community/dns.nix";
84 inputs.flake-utils.follows = "flake-utils";
85 inputs.nixpkgs.follows = "nixpkgs";
86 };
87 golink = {
88 url = "github:tailscale/golink";
89 inputs.flake-utils.follows = "flake-utils";
90 inputs.nixpkgs.follows = "nixpkgs";
91 };
92 hardware = {
93 url = "github:nixos/nixos-hardware";
94 };
95 home-manager = {
96 url = "github:nix-community/home-manager";
97 inputs.nixpkgs.follows = "nixpkgs";
98 };
99 iceshrimp = {
100 url = "git+https://iceshrimp.dev/pyrox/packaging";
101 inputs.nixpkgs.follows = "nixpkgs";
102 };
103 mailserver = {
104 url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master";
105 inputs = {
106 flake-compat.follows = "flake-compat";
107 nixpkgs.follows = "nixpkgs";
108 };
109 };
110 nix-search = {
111 url = "github:diamondburned/nix-search";
112 inputs.nixpkgs.follows = "nixpkgs";
113 inputs.flake-utils.follows = "flake-utils";
114 inputs.flake-compat.follows = "flake-compat";
115 };
116 nh = {
117 url = "github:viperML/nh";
118 inputs.nixpkgs.follows = "nixpkgs";
119 };
120 nixd = {
121 url = "github:nix-community/nixd";
122 inputs.nixpkgs.follows = "nixpkgs";
123 inputs.flake-parts.follows = "flake-parts";
124 };
125 nix-index = {
126 url = "github:nix-community/nix-index";
127 inputs.flake-compat.follows = "flake-compat";
128 inputs.nixpkgs.follows = "nixpkgs";
129 };
130 nix-index-database = {
131 url = "github:Mic92/nix-index-database";
132 inputs.nixpkgs.follows = "nixpkgs";
133 };
134 my-pkgs = {
135 url = "git+https://git.pyrox.dev/pyrox/pkgs";
136 inputs.nixpkgs.follows = "nixpkgs";
137 };
138 topology = {
139 url = "github:oddlama/nix-topology";
140 inputs.nixpkgs.follows = "nixpkgs";
141 inputs.flake-utils.follows = "flake-utils";
142 };
143 };
144
145 outputs =
146 inputs@{ self, ... }:
147 let
148 lib = inputs.snowfall-lib.mkLib {
149 inherit inputs;
150 src = ./.;
151 snowfall = {
152 meta = {
153 name = "pyronet";
154 title = "PyroNet Config";
155 };
156 namespace = "py";
157 };
158 };
159 overlays = [
160 self.overlays.pyronet-packages
161 self.overlays.nix-index
162 self.overlays.bluez-wiimote
163 self.overlays.sway-unwrapped
164 inputs.my-pkgs.overlays.cinny
165 inputs.golink.overlay
166 inputs.nixd.overlays.default
167 inputs.topology.overlays.default
168 ];
169 in
170 lib.mkFlake {
171 # Nixpkgs configuration
172 channels-config = {
173 allowUnfree = true;
174 };
175
176 # Overlays for Nixpkgs.
177 inherit overlays;
178
179 # Home-manager configurations
180 homes = {
181 # Default modules for all homes
182 modules = with inputs; [
183 nix-index-database.hmModules.nix-index
184 ctp.homeManagerModules.catppuccin
185 ];
186 };
187
188 # NixOS Configurations
189 systems = {
190 # Modules for all systems
191 modules.nixos = with inputs; [
192 agenix.nixosModules.default
193 buildbot-nix.nixosModules.buildbot-worker
194 ctp.nixosModules.catppuccin
195 topology.nixosModules.default
196 ];
197 hosts = {
198 # Zaphod, my personal Framework 16 laptop
199 zaphod.modules = with inputs; [ hardware.nixosModules.framework-16-7040-amd ];
200
201 # Prefect, my main VPS
202 prefect.modules = with inputs; [ mailserver.nixosModule ];
203
204 # Marvin, my main homelab machine
205 marvin.modules = with inputs; [
206 authentik.nixosModules.default
207 buildbot-nix.nixosModules.buildbot-master
208 golink.nixosModules.default
209 iceshrimp.nixosModules.default
210 ];
211 };
212 };
213 templates = {
214 uv.description = "Python template flake that uses uv";
215 };
216
217 outputs-builder = channels: {
218 # Define default packages to use everywhere
219 packages = {
220 nvim = channels.nixpkgs.neovim-unwrapped;
221 customGit = channels.nixpkgs.git.override {
222 withLibsecret = true;
223 withSsh = true;
224 perlSupport = false;
225 osxkeychainSupport = false;
226 guiSupport = false;
227 svnSupport = false;
228 };
229 };
230 formatter = channels.nixpkgs.nixfmt-rfc-style;
231
232 };
233 deploy = lib.mkDeploy { inherit (inputs) self; };
234 topology = import inputs.topology {
235 pkgs = import inputs.nixpkgs {
236 inherit overlays;
237 system = "x86_64-linux";
238 };
239 modules = [
240 ./topology.nix
241 { nixosConfigurations = self.nixosConfigurations; }
242 ];
243 };
244
245 };
246}