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 tangled-sh = {
121 url = "git+https://tangled.sh/@tangled.sh/core";
122 inputs.nixpkgs.follows = "nixpkgs";
123 };
124 };
125
126 outputs =
127 inputs@{ self, ... }:
128 let
129 lib = inputs.snowfall-lib.mkLib {
130 inherit inputs;
131 src = ./.;
132 snowfall = {
133 meta = {
134 name = "pyronet";
135 title = "PyroNet Config";
136 };
137 namespace = "py";
138 };
139 };
140 overlays = [
141 self.overlays.pyronet-packages
142 self.overlays.nix-index
143 # self.overlays.linux-firmware
144 inputs.golink.overlays.default
145 ];
146 in
147 lib.mkFlake {
148 # Nixpkgs configuration
149 channels-config = {
150 allowUnfree = true;
151 };
152
153 # Overlays for Nixpkgs.
154 inherit overlays;
155
156 # Home-manager configurations
157 homes = {
158 # Default modules for all homes
159 modules = with inputs; [
160 nix-index-database.homeModules.nix-index
161 ctp.homeModules.catppuccin
162 ];
163 };
164
165 # NixOS Configurations
166 systems = {
167 # Modules for all systems
168 modules.nixos = with inputs; [
169 agenix.nixosModules.default
170 buildbot-nix.nixosModules.buildbot-worker
171 ctp.nixosModules.catppuccin
172 ];
173 hosts = {
174 # Zaphod, my personal Framework 16 laptop
175 zaphod.modules = with inputs; [ hardware.nixosModules.framework-16-7040-amd ];
176
177 # Prefect, my main VPS
178 prefect.modules = with inputs; [ mailserver.nixosModule ];
179
180 # Marvin, my main homelab machine
181 marvin.modules = with inputs; [
182 buildbot-nix.nixosModules.buildbot-master
183 golink.nixosModules.default
184 iceshrimp.nixosModules.default
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}