add cloudflared

This commit is contained in:
Osman Faruk Bayram 2025-04-13 16:53:58 +03:00
parent 9b30ae2216
commit 1de45dbbd9
3 changed files with 33 additions and 1 deletions

View file

@ -0,0 +1,30 @@
{
config,
lib,
...
}: {
options = {
myModules.enableCloudflared = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable Cloudflare tunnels";
};
};
config = lib.mkMerge [
(lib.mkIf config.myModules.enableCloudflared {
services.cloudflared = {
enable = true;
credentialsFile = "/home/osbm/.cloudflared/cert.pem";
tunnels."ffe51e83-5516-44e5-9c8b-2b140cdfece9" = {
default = "http_status:404";
ingress = {
"git.osbm.dev" = {
service = "http://localhost:3000";
};
};
};
};
})
];
}