summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth Flynn <[email protected]>2025-02-08 22:26:14 -0500
committerSeth Flynn <[email protected]>2025-02-08 22:26:14 -0500
commit27ee06907dad412a17ea0e7d5a82c733a69ff4b3 (patch)
tree2058d14199a6446f8ec2a36766c3a4e745c2bea6
parent0d5b0b8569e75a3cc4af331c91e58bc8dc6d948f (diff)
nixos/cloudflared: drop
-rw-r--r--modules/nixos/mixins/cloudflared.nix60
-rw-r--r--modules/nixos/mixins/default.nix1
2 files changed, 0 insertions, 61 deletions
diff --git a/modules/nixos/mixins/cloudflared.nix b/modules/nixos/mixins/cloudflared.nix
deleted file mode 100644
index 372103b..0000000
--- a/modules/nixos/mixins/cloudflared.nix
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- config,
- lib,
- secretsDir,
- ...
-}:
-let
- cfg = config.mixins.cloudflared;
- inherit (config.services) nginx;
-in
-{
- options.mixins.cloudflared = {
- enable = lib.mkEnableOption "cloudflared mixin";
- tunnelName = lib.mkOption {
- description = ''
- Name of the default tunnel being created
- '';
- type = lib.types.str;
- default = "${config.networking.hostName}-nginx";
- defaultText = lib.literalExpression "\${config.networking.hostName}-nginx";
- example = "my-tunnel";
- };
-
- manageSecrets = lib.mkEnableOption "automatic management of secrets" // {
- default = config.traits.secrets.enable;
- defaultText = lib.literalExpression "config.traits.secrets.enable";
- };
- };
-
- config = lib.mkIf cfg.enable (
- lib.mkMerge [
- {
- services.cloudflared = {
- enable = true;
- tunnels.${cfg.tunnelName} = {
- default = "http_status:404";
-
- # map our virtualHosts from nginx to ingress rules
- ingress = lib.mapAttrs (_: _: {
- service = "http://localhost:${toString nginx.defaultHTTPListenPort}";
- }) nginx.virtualHosts;
- };
- };
- }
-
- (lib.mkIf cfg.manageSecrets {
- age.secrets.cloudflaredCreds = {
- file = secretsDir + "/cloudflaredCreds.age";
- mode = "400";
- owner = "cloudflared";
- group = "cloudflared";
- };
-
- services.cloudflared.tunnels.${cfg.tunnelName} = {
- credentialsFile = config.age.secrets.cloudflaredCreds.path;
- };
- })
- ]
- );
-}
diff --git a/modules/nixos/mixins/default.nix b/modules/nixos/mixins/default.nix
index 8b8b844..63a72d7 100644
--- a/modules/nixos/mixins/default.nix
+++ b/modules/nixos/mixins/default.nix
@@ -1,7 +1,6 @@
{
imports = [
./acme.nix
- ./cloudflared.nix
./forgejo.nix
./hercules.nix
./nginx.nix