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 buildbot-nix = {
58 url = "github:Mic92/buildbot-nix";
59 inputs.nixpkgs.follows = "nixpkgs";
60 inputs.flake-parts.follows = "flake-parts";
61 };
62 ctp = {
63 url = "github:catppuccin/nix";
64 };
65 deploy-rs = {
66 url = "github:serokell/deploy-rs";
67 inputs = {
68 nixpkgs.follows = "nixpkgs";
69 utils.follows = "flake-utils";
70 flake-compat.follows = "flake-compat";
71 };
72 };
73 dns = {
74 url = "github:nix-community/dns.nix";
75 inputs.flake-utils.follows = "flake-utils";
76 inputs.nixpkgs.follows = "nixpkgs";
77 };
78 golink = {
79 url = "github:tailscale/golink";
80 inputs.systems.follows = "systems";
81 inputs.nixpkgs.follows = "nixpkgs";
82 };
83 hardware = {
84 url = "github:nixos/nixos-hardware";
85 };
86 home-manager = {
87 url = "github:nix-community/home-manager";
88 inputs.nixpkgs.follows = "nixpkgs";
89 };
90 iceshrimp = {
91 url = "git+https://iceshrimp.dev/pyrox/packaging";
92 inputs.nixpkgs.follows = "nixpkgs";
93 };
94 mailserver = {
95 url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master";
96 inputs = {
97 flake-compat.follows = "flake-compat";
98 nixpkgs.follows = "nixpkgs";
99 };
100 };
101 nix-search = {
102 url = "github:diamondburned/nix-search";
103 inputs.nixpkgs.follows = "nixpkgs";
104 inputs.flake-utils.follows = "flake-utils";
105 inputs.flake-compat.follows = "flake-compat";
106 };
107 nix-index = {
108 url = "github:nix-community/nix-index";
109 inputs.flake-compat.follows = "flake-compat";
110 inputs.nixpkgs.follows = "nixpkgs";
111 };
112 nix-index-database = {
113 url = "github:Mic92/nix-index-database";
114 inputs.nixpkgs.follows = "nixpkgs";
115 };
116 my-pkgs = {
117 url = "git+https://git.pyrox.dev/pyrox/pkgs";
118 inputs.nixpkgs.follows = "nixpkgs";
119 };
120 topology = {
121 url = "github:oddlama/nix-topology";
122 inputs.nixpkgs.follows = "nixpkgs";
123 inputs.flake-utils.follows = "flake-utils";
124 };
125 };
126
127 outputs =
128 inputs@{ self, ... }:
129 let
130 lib = inputs.snowfall-lib.mkLib {
131 inherit inputs;
132 src = ./.;
133 snowfall = {
134 meta = {
135 name = "pyronet";
136 title = "PyroNet Config";
137 };
138 namespace = "py";
139 };
140 };
141 overlays = [
142 self.overlays.pyronet-packages
143 self.overlays.nix-index
144 self.overlays.sway-unwrapped
145 self.overlays.poptracker
146 inputs.golink.overlays.default
147 inputs.topology.overlays.default
148 ];
149 in
150 lib.mkFlake {
151 # Nixpkgs configuration
152 channels-config = {
153 allowUnfree = true;
154 };
155
156 # Overlays for Nixpkgs.
157 inherit overlays;
158
159 # Home-manager configurations
160 homes = {
161 # Default modules for all homes
162 modules = with inputs; [
163 nix-index-database.hmModules.nix-index
164 ctp.homeModules.catppuccin
165 ];
166 };
167
168 # NixOS Configurations
169 systems = {
170 # Modules for all systems
171 modules.nixos = with inputs; [
172 agenix.nixosModules.default
173 buildbot-nix.nixosModules.buildbot-worker
174 ctp.nixosModules.catppuccin
175 topology.nixosModules.default
176 ];
177 hosts = {
178 # Zaphod, my personal Framework 16 laptop
179 zaphod.modules = with inputs; [ hardware.nixosModules.framework-16-7040-amd ];
180
181 # Prefect, my main VPS
182 prefect.modules = with inputs; [ mailserver.nixosModule ];
183
184 # Marvin, my main homelab machine
185 marvin.modules = with inputs; [
186 authentik.nixosModules.default
187 buildbot-nix.nixosModules.buildbot-master
188 golink.nixosModules.default
189 iceshrimp.nixosModules.default
190 ];
191 };
192 };
193 templates = {
194 uv.description = "Python template flake that uses uv";
195 };
196
197 outputs-builder = channels: {
198 # Define default packages to use everywhere
199 packages = {
200 nvim = channels.nixpkgs.neovim-unwrapped;
201 };
202 formatter = channels.nixpkgs.nixfmt-rfc-style;
203
204 };
205 deploy = lib.mkDeploy { inherit (inputs) self; };
206 topology = import inputs.topology {
207 pkgs = import inputs.nixpkgs {
208 inherit overlays;
209 system = "x86_64-linux";
210 };
211 modules = [
212 ./topology.nix
213 { nixosConfigurations = self.nixosConfigurations; }
214 ];
215 };
216
217 };
218}