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.parts.follows = "flake-parts";
90 inputs.systems.follows = "systems";
91 inputs.nixpkgs.follows = "nixpkgs";
92 };
93 hardware = {
94 url = "github:nixos/nixos-hardware";
95 };
96 home-manager = {
97 url = "github:nix-community/home-manager";
98 inputs.nixpkgs.follows = "nixpkgs";
99 };
100 iceshrimp = {
101 url = "git+https://iceshrimp.dev/pyrox/packaging";
102 inputs.nixpkgs.follows = "nixpkgs";
103 };
104 mailserver = {
105 url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master";
106 inputs = {
107 flake-compat.follows = "flake-compat";
108 nixpkgs.follows = "nixpkgs";
109 };
110 };
111 nix-search = {
112 url = "github:diamondburned/nix-search";
113 inputs.nixpkgs.follows = "nixpkgs";
114 inputs.flake-utils.follows = "flake-utils";
115 inputs.flake-compat.follows = "flake-compat";
116 };
117 nh = {
118 url = "github:viperML/nh";
119 inputs.nixpkgs.follows = "nixpkgs";
120 };
121 nixd = {
122 url = "github:nix-community/nixd";
123 inputs.nixpkgs.follows = "nixpkgs";
124 inputs.flake-parts.follows = "flake-parts";
125 };
126 nix-index = {
127 url = "github:nix-community/nix-index";
128 inputs.flake-compat.follows = "flake-compat";
129 inputs.nixpkgs.follows = "nixpkgs";
130 };
131 nix-index-database = {
132 url = "github:Mic92/nix-index-database";
133 inputs.nixpkgs.follows = "nixpkgs";
134 };
135 my-pkgs = {
136 url = "git+https://git.pyrox.dev/pyrox/pkgs";
137 inputs.nixpkgs.follows = "nixpkgs";
138 };
139 topology = {
140 url = "github:oddlama/nix-topology";
141 inputs.nixpkgs.follows = "nixpkgs";
142 inputs.flake-utils.follows = "flake-utils";
143 };
144 };
145
146 outputs =
147 inputs@{ self, ... }:
148 let
149 lib = inputs.snowfall-lib.mkLib {
150 inherit inputs;
151 src = ./.;
152 snowfall = {
153 meta = {
154 name = "pyronet";
155 title = "PyroNet Config";
156 };
157 namespace = "py";
158 };
159 };
160 overlays = [
161 self.overlays.pyronet-packages
162 self.overlays.nix-index
163 self.overlays.sway-unwrapped
164 inputs.golink.overlays.default
165 inputs.nixd.overlays.default
166 inputs.topology.overlays.default
167 ];
168 in
169 lib.mkFlake {
170 # Nixpkgs configuration
171 channels-config = {
172 allowUnfree = true;
173 };
174
175 # Overlays for Nixpkgs.
176 inherit overlays;
177
178 # Home-manager configurations
179 homes = {
180 # Default modules for all homes
181 modules = with inputs; [
182 nix-index-database.hmModules.nix-index
183 ctp.homeManagerModules.catppuccin
184 ];
185 };
186
187 # NixOS Configurations
188 systems = {
189 # Modules for all systems
190 modules.nixos = with inputs; [
191 agenix.nixosModules.default
192 buildbot-nix.nixosModules.buildbot-worker
193 ctp.nixosModules.catppuccin
194 topology.nixosModules.default
195 ];
196 hosts = {
197 # Zaphod, my personal Framework 16 laptop
198 zaphod.modules = with inputs; [ hardware.nixosModules.framework-16-7040-amd ];
199
200 # Prefect, my main VPS
201 prefect.modules = with inputs; [ mailserver.nixosModule ];
202
203 # Marvin, my main homelab machine
204 marvin.modules = with inputs; [
205 authentik.nixosModules.default
206 buildbot-nix.nixosModules.buildbot-master
207 golink.nixosModules.default
208 iceshrimp.nixosModules.default
209 ];
210 };
211 };
212 templates = {
213 uv.description = "Python template flake that uses uv";
214 };
215
216 outputs-builder = channels: {
217 # Define default packages to use everywhere
218 packages = {
219 nvim = channels.nixpkgs.neovim-unwrapped;
220 customGit = channels.nixpkgs.git.override {
221 withLibsecret = true;
222 withSsh = true;
223 perlSupport = false;
224 osxkeychainSupport = false;
225 guiSupport = false;
226 svnSupport = false;
227 };
228 };
229 formatter = channels.nixpkgs.nixfmt-rfc-style;
230
231 };
232 deploy = lib.mkDeploy { inherit (inputs) self; };
233 topology = import inputs.topology {
234 pkgs = import inputs.nixpkgs {
235 inherit overlays;
236 system = "x86_64-linux";
237 };
238 modules = [
239 ./topology.nix
240 { nixosConfigurations = self.nixosConfigurations; }
241 ];
242 };
243
244 };
245}