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