feat(cache): setup nix-serve #21

merged
opened by a.starrysky.fyi targeting main from private/minion/push-uwzzxnxzzrwr

Nix-serve is a cache server that sets up your nix store to be served as a binary cache. As we're not going to be using cachix anymore as we are on tangled, we need to do this to have a cache

Changed files
+40
packetmix
systems
+15
packetmix/systems/midnight/cache.nix
···
··· 1 + # SPDX-FileCopyrightText: 2025 FreshlyBakedCake 2 + # 3 + # SPDX-License-Identifier: MIT 4 + 5 + { 6 + networking.firewall.allowedTCPPorts = [ 1025 ]; 7 + 8 + services.nix-serve = { 9 + enable = true; 10 + secretKeyFile = "/secrets/cache/signer.key"; 11 + 12 + bindAddress = "0.0.0.0"; 13 + port = 1025; 14 + }; 15 + }
+7
packetmix/systems/midnight/secrets.nix
···
··· 1 + # SPDX-FileCopyrightText: 2025 FreshlyBakedCake 2 + # 3 + # SPDX-License-Identifier: MIT 4 + 5 + { 6 + clicks.storage.impermanence.persist.directories = [ "/secrets" ]; 7 + }
+18
packetmix/systems/teal/cache.nix
···
··· 1 + # SPDX-FileCopyrightText: 2025 FreshlyBakedCake 2 + # 3 + # SPDX-License-Identifier: MIT 4 + 5 + { 6 + services.nginx.enable = true; 7 + services.nginx.virtualHosts."cache.freshlybakedca.ke" = { 8 + addSSL = true; 9 + enableACME = true; 10 + acmeRoot = null; 11 + 12 + locations."/" = { 13 + proxyPass = "http://midnight:1025"; 14 + recommendedProxySettings = true; 15 + proxyWebsockets = true; 16 + }; 17 + }; 18 + }