Files
sydnix/modules/nixos/deertopia/cache.nix
Madeleine Sydney 1ff3d14dd3 feat(deertopia): Binary cache
- Provides a container whose traffic is routed through Mullvad VPN.
- An option `sydnix.deertopia.mullvad.container.modules` is provided to
  "hook into" the container's NixOS config.
2025-03-12 12:45:29 -06:00

26 lines
641 B
Nix

{ config, lib, pkgs, ... }:
let cfg = config.sydnix.deertopia.cache;
in {
options.sydnix.deertopia.cache.enable =
lib.mkEnableOption "Deertopia's binary cache";
config = lib.mkIf cfg.enable {
sydnix.sops.secrets.deertopia-cache-key.mode = "0600";
services.nix-serve = {
enable = true;
secretKeyFile = config.sops.secrets.deertopia-cache-key.path;
};
sydnix.deertopia.nginx.vhosts."cache".vhost = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass =
let port = builtins.toString config.services.nix-serve.port;
in "http://127.0.0.1:${port}";
};
};
}