1 { config, lib, options, pkgs, ... }:
7 cfg = config.services.pgpkeyserver-lite;
8 sksCfg = config.services.sks;
9 sksOpt = options.services.sks;
19 services.pgpkeyserver-lite = {
21 enable = mkEnableOption "pgpkeyserver-lite on a nginx vHost proxying to a gpg keyserver";
23 package = mkPackageOption pkgs "pgpkeyserver-lite" { };
28 Which hostname to set the vHost to that is proxying to sks.
32 hkpAddress = mkOption {
33 default = builtins.head sksCfg.hkpAddress;
34 defaultText = literalExpression "head config.${sksOpt.hkpAddress}";
37 Which IP address the sks-keyserver is listening on.
42 default = sksCfg.hkpPort;
43 defaultText = literalExpression "config.${sksOpt.hkpPort}";
46 Which port the sks-keyserver is listening on.
52 config = mkIf cfg.enable {
54 services.nginx.enable = true;
56 services.nginx.virtualHosts = let
57 hkpPort = builtins.toString cfg.hkpPort;
62 "/pks".extraConfig = ''
63 proxy_pass http://${cfg.hkpAddress}:${hkpPort};
64 proxy_pass_header Server;
65 add_header Via "1.1 ${cfg.hostname}";