B4J4KJXLDXXL6RUF3G5OIN75UXHLE3PB47MCBJ55RMF3F65IR4OQC 47PYJSHOM4S3MOFQOWE67T3PI7XYH3RRXUB3Q43WK3ASFCKC65QAC CSG2VQG5JHDIRDRDB5BHCTLWZ7LRQDLOMATR7D67HSTRFEDYLDCAC UH6ZL2HFCGZTK5LBAIWXYWP7F7ZO5ZY3OLHVCY6DOCDSH6ATSILQC RTBMBSBABSGTRICJ4AWBKWO3JJHBRKV6FGOMYPDD7X6SS6X35ZIQC HYBPXVO2BD6SK7IVFLS6YZFEN2HMSZDALXIUCJGSKVB3LYMLCWJAC P5QV3CCWAECHHBFH5VZDWJMMQQ45I4YE75Y4YMY4KNXFHKFLDQRAC OYR4AJTYZQUIAAVGO4O4O7AXFQUVC7AAVAXRGWKIIJRPUJCCZYMQC KOXYNEPMHOWPUOUDAIDAVC2ZPUCLFGN23BM6QJ4UIDGVN73SUO7AC XPKDQGFUFF4BT32ODPEJRZGBEOGZVDRAEN2EOWU7DBIN2QQX6KUAC 4R56PJDQPYZ5FLFAMZSNY7UI5TKF6N5YCHCJU3ZBV5FHB46GYM5QC LYEDM2AG74FSFHLK5J4ZPYJVT2VTQBKA6BPP2W6LWR3GBQM76PDAC IWFDDZQDLBZCSPQP3O2AWL5IHHM7KG5KL5JF7QG5AFLXSPLQQUTAC { self, config, lib, pkgs, ... }: letinherit (lib) enabled merge mkIf mkOption types;inherit (config.networking) domain;in {imports = [(self + /modules/nginx.nix)];options.cache = {enable = lib.mkEnableOption "nix-serve cache server";fqdn = lib.mkOption {type = types.str;example = "cache1.example.com";description = "Fully qualified domain name for the cache";};port = lib.mkOption {type = types.port;default = 8006;description = "Port for nix-serve to listen on";};secretKeyFile = lib.mkOption {type = types.path;example = "/run/agenix/nixServeKey";description = "Path to the secret key file for signing the cache";};};config = mkIf config.cache.enable {services.nix-serve = enabled {package = pkgs.nix-serve-ng;secretKeyFile = config.cache.secretKeyFile;bindAddress = "127.0.0.1";port = config.cache.port;};services.nginx.virtualHosts.${config.cache.fqdn} = merge config.services.nginx.sslTemplate {locations."= /".return = "301 https://${domain}/404";locations."/".proxyPass = "http://127.0.0.1:${toString config.cache.port}";};};}
{ self, config, lib, pkgs, ... }: letinherit (config.networking) domain;inherit (lib) enabled merge;portNixServe = 8006;in {imports = [(self + /modules/nginx.nix)];age.secrets.nixServeKey = {owner = "root";};services.nix-serve = enabled {package = pkgs.nix-serve-ng;secretKeyFile = config.age.secrets.nixServeKey.path;bindAddress = "127.0.0.1";port = portNixServe;};services.nginx.virtualHosts.${fqdn} = merge config.services.nginx.sslTemplate {locations."= /".return = "301 https://${domain}/404";locations."/".proxyPass = "http://127.0.0.1:${toString portNixServe}";};}rekeyFile = self + /secrets/plum-cache-key.age;fqdn = "cache1.${domain}";
{ self, config, lib, pkgs, ... }: letinherit (lib) enabled merge;cacheDomain = "plumj.am";fqdn = "cache2.${cacheDomain}";portNixServe = 8007;in {imports = [(self + /modules/nginx.nix)];age.secrets.nixServeKey = {owner = "root";};services.nix-serve = enabled {package = pkgs.nix-serve-ng;secretKeyFile = config.age.secrets.nixServeKey.path;bindAddress = "127.0.0.1";port = portNixServe;};services.nginx.virtualHosts.${fqdn} = merge config.services.nginx.sslTemplate {locations."= /".return = "301 https://${cacheDomain}/404";locations."/".proxyPass = "http://127.0.0.1:${toString portNixServe}";};}rekeyFile = self + /secrets/kiwi-cache-key.age;