1
Fork 0

Set up microbin

This commit is contained in:
prescientmoon 2024-05-09 15:20:03 +02:00
parent 6427d73464
commit 1396706e07
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
8 changed files with 75 additions and 19 deletions

View file

@ -0,0 +1,22 @@
{ 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 {
type = lib.types.functionTo (lib.types.functionTo lib.types.anything);
description = "Helper function for generating a quick proxy config";
};
};
config.satellite.proxy = from: port: {
${cfg.tunnel} = {
ingress.${from} = "http://localhost${toString port}";
};
};
}

View file

@ -2,6 +2,7 @@
{
# example = import ./example.nix;
cloudflaredd = import ./cloudflared.nix;
nginx = import ./nginx.nix;
pounce = import ./pounce.nix;
}