push
This commit is contained in:
@@ -2,4 +2,4 @@
|
|||||||
# Do not delete.
|
# Do not delete.
|
||||||
|
|
||||||
folderID: nix
|
folderID: nix
|
||||||
created: 2026-01-29T23:05:44-06:00
|
created: 2026-01-29T23:06:32-06:00
|
||||||
|
|||||||
@@ -3,23 +3,32 @@
|
|||||||
den.aspects.box = {
|
den.aspects.box = {
|
||||||
includes = with den.aspects; [
|
includes = with den.aspects; [
|
||||||
den.default
|
den.default
|
||||||
den.provides.home-manager
|
# den.provides.home-manager
|
||||||
syncthing
|
syncthing
|
||||||
fish
|
fish
|
||||||
|
|
||||||
cloudflared
|
#cloudflared
|
||||||
searxng
|
searxng
|
||||||
copyparty
|
copyparty
|
||||||
glances
|
glances
|
||||||
# invidious
|
# invidious
|
||||||
mailserver
|
mailserver
|
||||||
#matrix
|
# matrix
|
||||||
redlib
|
redlib
|
||||||
#sish
|
# sish
|
||||||
vscode-server
|
vscode-server
|
||||||
dns
|
dns
|
||||||
openssh
|
openssh
|
||||||
gitea
|
gitea
|
||||||
|
|
||||||
|
|
||||||
|
(den.provides.cloudflared-tunnel "tvtun" 3001)
|
||||||
|
(den.provides.cloudflared-tunnel "search" 8888)
|
||||||
|
(den.provides.cloudflared-tunnel "files" 3210)
|
||||||
|
(den.provides.cloudflared-tunnel "tube" 3030)
|
||||||
|
(den.provides.cloudflared-tunnel "monitor" 61208)
|
||||||
|
(den.provides.cloudflared-tunnel "reddit" 8975)
|
||||||
|
(den.provides.cloudflared-tunnel "git" 3000)
|
||||||
];
|
];
|
||||||
|
|
||||||
nixos = {
|
nixos = {
|
||||||
|
|||||||
55
modules/infra/cloudflare-tunnel.nix
Normal file
55
modules/infra/cloudflare-tunnel.nix
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# cloudflared/battery.nix
|
||||||
|
{ den, ... }:
|
||||||
|
let
|
||||||
|
|
||||||
|
description = ''
|
||||||
|
Configures a Cloudflare tunnel ingress rule for a given subdomain and port.
|
||||||
|
Assumes the tunnel UUID and credentials are fixed for this machine.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
den.aspects.bug.includes = [
|
||||||
|
(den.provides.cloudflared-tunnel "search" 8888)
|
||||||
|
(den.provides.cloudflared-tunnel "tube" 3030)
|
||||||
|
(den.provides.cloudflared-tunnel "git" 3000)
|
||||||
|
];
|
||||||
|
|
||||||
|
Each call adds one ingress entry: <subdomain>.bug.tools -> http://127.0.0.1:<port>
|
||||||
|
The base tunnel setup (enable, credentials, default) is included every time
|
||||||
|
and merges safely via the NixOS module system.
|
||||||
|
'';
|
||||||
|
|
||||||
|
TUNNEL_UUID = "4118935e-359b-4dd2-95bd-eb27f7b0c5bb";
|
||||||
|
DOMAIN = "bug.tools";
|
||||||
|
CREDS_PATH = "/home/bug/.cloudflared/${TUNNEL_UUID}.json";
|
||||||
|
|
||||||
|
tunnelNixos = subdomain: port: { pkgs, ... }: {
|
||||||
|
environment.systemPackages = [ pkgs.cloudflared ];
|
||||||
|
|
||||||
|
environment.etc."cloudflared/${TUNNEL_UUID}.json".source = CREDS_PATH;
|
||||||
|
|
||||||
|
services.cloudflared = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
tunnels.${TUNNEL_UUID} = {
|
||||||
|
credentialsFile = "/etc/cloudflared/${TUNNEL_UUID}.json";
|
||||||
|
default = "http_status:404";
|
||||||
|
|
||||||
|
ingress = {
|
||||||
|
"${subdomain}.${DOMAIN}" = "http://127.0.0.1:${toString port}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
den.provides.cloudflared-tunnel =
|
||||||
|
subdomain: port:
|
||||||
|
den.lib.parametric {
|
||||||
|
inherit description;
|
||||||
|
includes = [
|
||||||
|
(_: { nixos = tunnelNixos subdomain port; })
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/*
|
||||||
{
|
{
|
||||||
den.aspects.cloudflared = {
|
den.aspects.cloudflared = {
|
||||||
nixos = { pkgs, ...}: let
|
nixos = { pkgs, ...}: let
|
||||||
@@ -30,3 +31,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
{}
|
||||||
|
|||||||
@@ -3,16 +3,11 @@
|
|||||||
nixos = {
|
nixos = {
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
|
||||||
database = {
|
|
||||||
type = "sqlite3";
|
|
||||||
path = "/var/lib/gitea/gitea.db";
|
|
||||||
};
|
|
||||||
|
|
||||||
server = {
|
database.type = "mysql";
|
||||||
domain = "example.com";
|
|
||||||
httpPort = 3000;
|
settings.service = {
|
||||||
};
|
DISABLE_REGISTRATION = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
"matrix@bug.tools"
|
"matrix@bug.tools"
|
||||||
"fluxer@bug.tools"
|
"fluxer@bug.tools"
|
||||||
"git@bug.tools"
|
"git@bug.tools"
|
||||||
|
"contact@bug.tools"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
general:
|
general:
|
||||||
# Debug mode, only for development. Is overwritten by ${SEARXNG_DEBUG}
|
|
||||||
debug: false
|
debug: false
|
||||||
# displayed name
|
|
||||||
instance_name: "search.bug.tools"
|
instance_name: "search.bug.tools"
|
||||||
# For example: https://example.com/privacy
|
# For example: https://example.com/privacy
|
||||||
privacypolicy_url: false
|
privacypolicy_url: false
|
||||||
@@ -9,7 +7,7 @@ general:
|
|||||||
# use false to disable the donation link
|
# use false to disable the donation link
|
||||||
donation_url: false
|
donation_url: false
|
||||||
# mailto:contact@example.com
|
# mailto:contact@example.com
|
||||||
contact_url: false
|
contact_url: contact@bug.tools
|
||||||
# record stats
|
# record stats
|
||||||
enable_metrics: true
|
enable_metrics: true
|
||||||
# expose stats in open metrics format at /metrics
|
# expose stats in open metrics format at /metrics
|
||||||
@@ -2177,7 +2175,7 @@ engines:
|
|||||||
- name: yahoo
|
- name: yahoo
|
||||||
engine: yahoo
|
engine: yahoo
|
||||||
shortcut: yh
|
shortcut: yh
|
||||||
|
|
||||||
- name: yahoo news
|
- name: yahoo news
|
||||||
engine: yahoo_news
|
engine: yahoo_news
|
||||||
shortcut: yhn
|
shortcut: yhn
|
||||||
@@ -2823,4 +2821,4 @@ doi_resolvers:
|
|||||||
sci-hub.st: 'https://sci-hub.st/'
|
sci-hub.st: 'https://sci-hub.st/'
|
||||||
sci-hub.ru: 'https://sci-hub.ru/'
|
sci-hub.ru: 'https://sci-hub.ru/'
|
||||||
|
|
||||||
default_doi_resolver: 'oadoi.org'
|
default_doi_resolver: 'oadoi.org'
|
||||||
|
|||||||
Reference in New Issue
Block a user