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.systems.follows = "systems";
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 nix-index = {
117 url = "github:nix-community/nix-index";
118 inputs.flake-compat.follows = "flake-compat";
119 inputs.nixpkgs.follows = "nixpkgs";
120 };
121 nix-index-database = {
122 url = "github:Mic92/nix-index-database";
123 inputs.nixpkgs.follows = "nixpkgs";
124 };
125 my-pkgs = {
126 url = "git+https://git.pyrox.dev/pyrox/pkgs";
127 inputs.nixpkgs.follows = "nixpkgs";
128 };
129 topology = {
130 url = "github:oddlama/nix-topology";
131 inputs.nixpkgs.follows = "nixpkgs";
132 inputs.flake-utils.follows = "flake-utils";
133 };
134 };
135
136 outputs =
137 inputs@{ self, ... }:
138 let
139 lib = inputs.snowfall-lib.mkLib {
140 inherit inputs;
141 src = ./.;
142 snowfall = {
143 meta = {
144 name = "pyronet";
145 title = "PyroNet Config";
146 };
147 namespace = "py";
148 };
149 };
150 overlays = [
151 self.overlays.pyronet-packages
152 self.overlays.nix-index
153 self.overlays.sway-unwrapped
154 self.overlays.poptracker
155 inputs.golink.overlays.default
156 inputs.topology.overlays.default
157 ];
158 in
159 lib.mkFlake {
160 # Nixpkgs configuration
161 channels-config = {
162 allowUnfree = true;
163 };
164
165 # Overlays for Nixpkgs.
166 inherit overlays;
167
168 # Home-manager configurations
169 homes = {
170 # Default modules for all homes
171 modules = with inputs; [
172 nix-index-database.hmModules.nix-index
173 ctp.homeModules.catppuccin
174 ];
175 };
176
177 # NixOS Configurations
178 systems = {
179 # Modules for all systems
180 modules.nixos = with inputs; [
181 agenix.nixosModules.default
182 buildbot-nix.nixosModules.buildbot-worker
183 ctp.nixosModules.catppuccin
184 topology.nixosModules.default
185 ];
186 hosts = {
187 # Zaphod, my personal Framework 16 laptop
188 zaphod.modules = with inputs; [ hardware.nixosModules.framework-16-7040-amd ];
189
190 # Prefect, my main VPS
191 prefect.modules = with inputs; [ mailserver.nixosModule ];
192
193 # Marvin, my main homelab machine
194 marvin.modules = with inputs; [
195 authentik.nixosModules.default
196 buildbot-nix.nixosModules.buildbot-master
197 golink.nixosModules.default
198 iceshrimp.nixosModules.default
199 ];
200 };
201 };
202 templates = {
203 uv.description = "Python template flake that uses uv";
204 };
205
206 outputs-builder = channels: {
207 # Define default packages to use everywhere
208 packages = {
209 nvim = channels.nixpkgs.neovim-unwrapped;
210 };
211 formatter = channels.nixpkgs.nixfmt-rfc-style;
212
213 };
214 deploy = lib.mkDeploy { inherit (inputs) self; };
215 topology = import inputs.topology {
216 pkgs = import inputs.nixpkgs {
217 inherit overlays;
218 system = "x86_64-linux";
219 };
220 modules = [
221 ./topology.nix
222 { nixosConfigurations = self.nixosConfigurations; }
223 ];
224 };
225
226 };
227}