Set up microbin
This commit is contained in:
parent
6427d73464
commit
1396706e07
8 changed files with 75 additions and 19 deletions
modules/nixos
22
modules/nixos/cloudflared.nix
Normal file
22
modules/nixos/cloudflared.nix
Normal 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}";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
{
|
||||
# example = import ./example.nix;
|
||||
cloudflaredd = import ./cloudflared.nix;
|
||||
nginx = import ./nginx.nix;
|
||||
pounce = import ./pounce.nix;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue