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 ];
9 trusted-public-keys = [
10 "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
11 "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
12 ];
13 cores = 0;
14 max-jobs = 2;
15 netrc-file = "/home/thehedgehog/.netrc";
16 };
17 description = "PyroNet machines and services";
18
19 inputs = {
20 snowfall-lib = {
21 url = "github:snowfallorg/lib";
22 inputs.nixpkgs.follows = "nixpkgs";
23 inputs.flake-compat.follows = "flake-compat";
24 };
25 nixpkgs.url = "https://nixpkgs.dev/channel/nixpkgs-unstable";
26 stable.url = "github:nixos/nixpkgs/nixos-24.05";
27 # Overrides
28 flake-compat.url = "github:edolstra/flake-compat";
29 systems.url = "github:nix-systems/default";
30 flake-parts = {
31 url = "github:hercules-ci/flake-parts";
32 inputs.nixpkgs-lib.follows = "nixpkgs-lib";
33 };
34 flake-utils = {
35 url = "github:numtide/flake-utils";
36 inputs.systems.follows = "systems";
37 };
38 nixpkgs-lib.url = "github:nix-community/nixpkgs.lib";
39
40 # Inputs
41 agenix = {
42 url = "github:ryantm/agenix";
43 inputs = {
44 nixpkgs.follows = "nixpkgs";
45 systems.follows = "systems";
46 home-manager.follows = "home-manager";
47 };
48 };
49 buildbot-nix = {
50 url = "github:Mic92/buildbot-nix";
51 inputs.nixpkgs.follows = "nixpkgs";
52 inputs.flake-parts.follows = "flake-parts";
53 };
54 ctp = {
55 url = "github:catppuccin/nix";
56 };
57 deploy-rs = {
58 url = "github:serokell/deploy-rs";
59 inputs = {
60 nixpkgs.follows = "nixpkgs";
61 utils.follows = "flake-utils";
62 flake-compat.follows = "flake-compat";
63 };
64 };
65 dns = {
66 url = "github:nix-community/dns.nix";
67 inputs.flake-utils.follows = "flake-utils";
68 inputs.nixpkgs.follows = "nixpkgs";
69 };
70
71 ghostty = {
72 url = "github:ghostty-org/ghostty";
73 inputs.nixpkgs.follows = "nixpkgs";
74 inputs.flake-utils.follows = "flake-utils";
75 inputs.flake-compat.follows = "flake-compat";
76 };
77 golink = {
78 url = "github:tailscale/golink";
79 inputs.systems.follows = "systems";
80 inputs.nixpkgs.follows = "nixpkgs";
81 };
82 hardware = {
83 url = "github:nixos/nixos-hardware";
84 };
85 home-manager = {
86 url = "github:nix-community/home-manager";
87 inputs.nixpkgs.follows = "nixpkgs";
88 };
89 iceshrimp = {
90 url = "git+https://iceshrimp.dev/pyrox/packaging";
91 inputs.nixpkgs.follows = "nixpkgs";
92 };
93 mailserver = {
94 url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master";
95 inputs = {
96 flake-compat.follows = "flake-compat";
97 nixpkgs.follows = "nixpkgs";
98 };
99 };
100 nix-search = {
101 url = "github:diamondburned/nix-search";
102 inputs.nixpkgs.follows = "nixpkgs";
103 inputs.flake-utils.follows = "flake-utils";
104 inputs.flake-compat.follows = "flake-compat";
105 };
106 nix-index = {
107 url = "github:nix-community/nix-index";
108 inputs.flake-compat.follows = "flake-compat";
109 inputs.nixpkgs.follows = "nixpkgs";
110 };
111 nix-index-database = {
112 url = "github:Mic92/nix-index-database";
113 inputs.nixpkgs.follows = "nixpkgs";
114 };
115 my-pkgs = {
116 url = "git+https://git.pyrox.dev/pyrox/pkgs";
117 inputs.nixpkgs.follows = "nixpkgs";
118 };
119 tangled-sh = {
120 url = "git+https://tangled.sh/@tangled.sh/core";
121 };
122 };
123
124 outputs =
125 inputs@{ self, ... }:
126 let
127 lib = inputs.snowfall-lib.mkLib {
128 inherit inputs;
129 src = ./.;
130 snowfall = {
131 meta = {
132 name = "pyronet";
133 title = "PyroNet Config";
134 };
135 namespace = "py";
136 };
137 };
138 overlays = [
139 self.overlays.pyronet-packages
140 self.overlays.nix-index
141 self.overlays.openssh-fixperms
142 inputs.golink.overlays.default
143 ];
144 in
145 lib.mkFlake {
146 # Nixpkgs configuration
147 channels-config = {
148 allowUnfree = true;
149 };
150
151 # Overlays for Nixpkgs.
152 inherit overlays;
153
154 # Home-manager configurations
155 homes = {
156 # Default modules for all homes
157 modules = with inputs; [
158 nix-index-database.homeModules.nix-index
159 ctp.homeModules.catppuccin
160 ];
161 };
162
163 # NixOS Configurations
164 systems = {
165 # Modules for all systems
166 modules.nixos = with inputs; [
167 agenix.nixosModules.default
168 buildbot-nix.nixosModules.buildbot-worker
169 ctp.nixosModules.catppuccin
170 ];
171 hosts = {
172 # Zaphod, my personal Framework 16 laptop
173 zaphod.modules = with inputs; [ hardware.nixosModules.framework-16-7040-amd ];
174
175 # Prefect, my main VPS
176 prefect.modules = with inputs; [ mailserver.nixosModule ];
177
178 # Marvin, my main homelab machine
179 marvin.modules = with inputs; [
180 buildbot-nix.nixosModules.buildbot-master
181 golink.nixosModules.default
182 iceshrimp.nixosModules.default
183 tangled-sh.nixosModules.knot
184 tangled-sh.nixosModules.spindle
185 ];
186 };
187 };
188 templates = {
189 uv.description = "Python template flake that uses uv";
190 };
191
192 outputs-builder = channels: {
193 # Define default packages to use everywhere
194 packages = {
195 nvim = channels.nixpkgs.neovim-unwrapped;
196 };
197 formatter = channels.nixpkgs.nixfmt-rfc-style;
198
199 };
200 deploy = lib.mkDeploy { inherit (inputs) self; };
201 };
202}