2024-05-09 15:20:03 +02:00
|
|
|
{ config, lib, ... }:
|
|
|
|
let cfg = config.satellite.cloudflared;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.satellite.cloudflared = {
|
|
|
|
tunnel = lib.mkOption {
|
|
|
|
type = lib.types.string;
|
|
|
|
description = "Cloudflare tunnel id to use for the `satellite.cloudflared.proxy` helper";
|
|
|
|
};
|
|
|
|
|
|
|
|
proxy = lib.mkOption {
|
2024-05-10 19:44:38 +02:00
|
|
|
type = lib.types.functionTo lib.types.anything;
|
2024-05-09 15:20:03 +02:00
|
|
|
description = "Helper function for generating a quick proxy config";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-10 19:43:00 +02:00
|
|
|
config.satellite.cloudflared.proxy = from: {
|
2024-05-09 15:20:03 +02:00
|
|
|
${cfg.tunnel} = {
|
2024-05-11 00:52:55 +02:00
|
|
|
ingress.${from} = "http://localhost:8418";
|
2024-05-09 15:20:03 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|