1{
2 nixConfig = {
3 experimental-features = "nix-command flakes";
4 substitute = "true";
5 extra-substituters = [
6 "https://cache.nixos.org"
7 "https://nix-community.cachix.org"
8 "https://install.determinate.systems"
9 ];
10 trusted-public-keys = [
11 "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
12 "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
13 "cache.flakehub.com-3:hJuILl5sVK4iKm86JzgdXW12Y2Hwd5G07qKtHTOcDCM="
14 ];
15 cores = 0;
16 max-jobs = 2;
17 netrc-file = "/home/thehedgehog/.netrc";
18 };
19 description = "PyroNet machines and services";
20
21 inputs = {
22 snowfall-lib = {
23 url = "github:snowfallorg/lib";
24 inputs.nixpkgs.follows = "nixpkgs";
25 inputs.flake-compat.follows = "flake-compat";
26 };
27 nixpkgs.url = "https://nixpkgs.dev/channel/nixpkgs-unstable";
28 stable.url = "github:nixos/nixpkgs/nixos-24.05";
29 # Overrides
30 flake-compat.url = "github:edolstra/flake-compat";
31 systems.url = "github:nix-systems/default";
32 flake-parts = {
33 url = "github:hercules-ci/flake-parts";
34 inputs.nixpkgs-lib.follows = "nixpkgs-lib";
35 };
36 flake-utils = {
37 url = "github:numtide/flake-utils";
38 inputs.systems.follows = "systems";
39 };
40 nixpkgs-lib.url = "github:nix-community/nixpkgs.lib";
41
42 # Inputs
43 agenix = {
44 url = "github:ryantm/agenix";
45 inputs = {
46 nixpkgs.follows = "nixpkgs";
47 systems.follows = "systems";
48 home-manager.follows = "home-manager";
49 };
50 };
51 buildbot-nix = {
52 url = "github:Mic92/buildbot-nix";
53 inputs.nixpkgs.follows = "nixpkgs";
54 inputs.flake-parts.follows = "flake-parts";
55 };
56 ctp = {
57 url = "github:catppuccin/nix";
58 };
59 deploy-rs = {
60 url = "github:serokell/deploy-rs";
61 inputs = {
62 nixpkgs.follows = "nixpkgs";
63 utils.follows = "flake-utils";
64 flake-compat.follows = "flake-compat";
65 };
66 };
67 determinate = {
68 url = "https://flakehub.com/f/DeterminateSystems/determinate/*";
69 };
70 dns = {
71 url = "github:nix-community/dns.nix";
72 inputs.flake-utils.follows = "flake-utils";
73 inputs.nixpkgs.follows = "nixpkgs";
74 };
75
76 ghostty = {
77 url = "github:ghostty-org/ghostty";
78 inputs.nixpkgs.follows = "nixpkgs";
79 inputs.flake-utils.follows = "flake-utils";
80 inputs.flake-compat.follows = "flake-compat";
81 };
82 golink = {
83 url = "github:tailscale/golink";
84 inputs.systems.follows = "systems";
85 inputs.nixpkgs.follows = "nixpkgs";
86 };
87 hardware = {
88 url = "github:nixos/nixos-hardware";
89 };
90 home-manager = {
91 url = "github:nix-community/home-manager";
92 inputs.nixpkgs.follows = "nixpkgs";
93 };
94 iceshrimp = {
95 url = "git+https://iceshrimp.dev/pyrox/packaging";
96 inputs.nixpkgs.follows = "nixpkgs";
97 };
98 mailserver = {
99 url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master";
100 inputs = {
101 flake-compat.follows = "flake-compat";
102 nixpkgs.follows = "nixpkgs";
103 };
104 };
105 nix-search = {
106 url = "github:diamondburned/nix-search";
107 inputs.nixpkgs.follows = "nixpkgs";
108 inputs.flake-utils.follows = "flake-utils";
109 inputs.flake-compat.follows = "flake-compat";
110 };
111 nix-index = {
112 url = "github:nix-community/nix-index";
113 inputs.flake-compat.follows = "flake-compat";
114 inputs.nixpkgs.follows = "nixpkgs";
115 };
116 nix-index-database = {
117 url = "github:Mic92/nix-index-database";
118 inputs.nixpkgs.follows = "nixpkgs";
119 };
120 my-pkgs = {
121 url = "git+https://git.pyrox.dev/pyrox/pkgs";
122 inputs.nixpkgs.follows = "nixpkgs";
123 };
124 tangled-sh = {
125 url = "git+https://tangled.sh/@tangled.sh/core";
126 };
127 };
128
129 outputs =
130 inputs@{ self, ... }:
131 let
132 lib = inputs.snowfall-lib.mkLib {
133 inherit inputs;
134 src = ./.;
135 snowfall = {
136 meta = {
137 name = "pyronet";
138 title = "PyroNet Config";
139 };
140 namespace = "py";
141 };
142 };
143 overlays = [
144 self.overlays.pyronet-packages
145 self.overlays.nix-index
146 self.overlays.openssh-fixperms
147 inputs.golink.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.homeModules.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 determinate.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 buildbot-nix.nixosModules.buildbot-master
187 golink.nixosModules.default
188 iceshrimp.nixosModules.default
189 tangled-sh.nixosModules.knot
190 tangled-sh.nixosModules.spindle
191 ];
192 };
193 };
194 templates = {
195 uv.description = "Python template flake that uses uv";
196 };
197
198 outputs-builder = channels: {
199 # Define default packages to use everywhere
200 packages = {
201 nvim = channels.nixpkgs.neovim-unwrapped;
202 };
203 formatter = channels.nixpkgs.nixfmt-rfc-style;
204
205 };
206 deploy = lib.mkDeploy { inherit (inputs) self; };
207 };
208}