2 Commits

Author SHA1 Message Date
Hadi ae024e308d Merge branch 'main' of github.com:anotherhadi/nixy 2026-04-06 15:13:17 +02:00
Hadi 302f0ceec9 Add variables for domain & tunnel id
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
2026-04-06 15:13:10 +02:00
18 changed files with 64 additions and 51 deletions
+3
View File
@@ -30,6 +30,9 @@
autoUpgrade = false; autoUpgrade = false;
autoGarbageCollector = true; autoGarbageCollector = true;
domain = "hadi.icu";
tunnelId = "a1dfa315-7fc3-4a65-8c02-8387932c35c3";
}; };
# Let this here # Let this here
+1 -1
View File
@@ -11,5 +11,5 @@
allowedUDPPorts = [53]; allowedUDPPorts = [53];
}; };
services.cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."adguard.hadi.icu" = "http://localhost:${toString config.services.adguardhome.port}"; services.cloudflared.tunnels."${config.var.tunnelId}".ingress."adguard.${config.var.domain}" = "http://localhost:${toString config.services.adguardhome.port}";
} }
+8 -8
View File
@@ -51,13 +51,13 @@ in {
users.users.jellyfin.extraGroups = ["video" "render"]; users.users.jellyfin.extraGroups = ["video" "render"];
services.cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress = { services.cloudflared.tunnels."${config.var.tunnelId}".ingress = {
"media.hadi.icu" = "http://localhost:8096"; "media.${config.var.domain}" = "http://localhost:8096";
"demandemedia.hadi.icu" = "http://localhost:5055"; "demandemedia.${config.var.domain}" = "http://localhost:5055";
"bazarr.hadi.icu" = "http://localhost:6767"; "bazarr.${config.var.domain}" = "http://localhost:6767";
"prowlarr.hadi.icu" = "http://localhost:9696"; "prowlarr.${config.var.domain}" = "http://localhost:9696";
"radarr.hadi.icu" = "http://localhost:7878"; "radarr.${config.var.domain}" = "http://localhost:7878";
"sonarr.hadi.icu" = "http://localhost:8989"; "sonarr.${config.var.domain}" = "http://localhost:8989";
"transmission.hadi.icu" = "http://localhost:9091"; "transmission.${config.var.domain}" = "http://localhost:9091";
}; };
} }
+2 -1
View File
@@ -1,4 +1,5 @@
{ {
config,
inputs, inputs,
pkgs, pkgs,
... ...
@@ -20,6 +21,6 @@
absolute_redirect off; absolute_redirect off;
''; '';
}; };
cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."wallpapers.hadi.icu" = "http://127.0.0.1:8759"; cloudflared.tunnels."${config.var.tunnelId}".ingress."wallpapers.${config.var.domain}" = "http://127.0.0.1:8759";
}; };
} }
+6 -5
View File
@@ -1,4 +1,5 @@
{ {
config,
inputs, inputs,
pkgs, pkgs,
... ...
@@ -19,7 +20,7 @@
extraConfig = '' extraConfig = ''
port_in_redirect off; port_in_redirect off;
absolute_redirect off; absolute_redirect off;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' data: https://umami.hadi.icu; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://git.hadi.icu; connect-src 'self' https://umami.hadi.icu;" always; add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' data: https://umami.${config.var.domain}; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://git.${config.var.domain}; connect-src 'self' https://umami.${config.var.domain};" always;
''; '';
}; };
@@ -31,14 +32,14 @@
} }
]; ];
extraConfig = '' extraConfig = ''
return 301 https://hadi.icu$request_uri; return 301 https://${config.var.domain}$request_uri;
''; '';
}; };
}; };
cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress = { cloudflared.tunnels."${config.var.tunnelId}".ingress = {
"hadi.icu" = "http://127.0.0.1:8758"; "${config.var.domain}" = "http://127.0.0.1:8758";
"www.hadi.icu" = "http://127.0.0.1:8189"; "www.${config.var.domain}" = "http://127.0.0.1:8189";
}; };
}; };
} }
+2 -2
View File
@@ -14,7 +14,7 @@
# This will create a credentials file & give you the tunnel ID to use below. # This will create a credentials file & give you the tunnel ID to use below.
services.cloudflared = { services.cloudflared = {
enable = true; enable = true;
tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3" = { tunnels."${config.var.tunnelId}" = {
credentialsFile = config.sops.secrets."cloudflared-token".path; credentialsFile = config.sops.secrets."cloudflared-token".path;
default = "http_status:404"; default = "http_status:404";
}; };
@@ -24,7 +24,7 @@
cloudflared cloudflared
]; ];
systemd.services."cloudflared-tunnel-a1dfa315-7fc3-4a65-8c02-8387932c35c3" = { systemd.services."cloudflared-tunnel-${config.var.tunnelId}" = {
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
after = ["network-online.target"]; after = ["network-online.target"];
wants = ["network-online.target"]; wants = ["network-online.target"];
+6 -2
View File
@@ -1,5 +1,9 @@
# Cyberchef is a web app for analyzing and decoding data. # Cyberchef is a web app for analyzing and decoding data.
{pkgs, ...}: { {
config,
pkgs,
...
}: {
services = { services = {
nginx.virtualHosts."cyberchef.local" = { nginx.virtualHosts."cyberchef.local" = {
root = "${pkgs.cyberchef}/share/cyberchef"; root = "${pkgs.cyberchef}/share/cyberchef";
@@ -10,6 +14,6 @@
} }
]; ];
}; };
cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."cyberchef.hadi.icu" = "http://localhost:8754"; cloudflared.tunnels."${config.var.tunnelId}".ingress."cyberchef.${config.var.domain}" = "http://localhost:8754";
}; };
} }
+1 -1
View File
@@ -4,5 +4,5 @@
port = 8087; port = 8087;
}; };
services.cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."default-creds.hadi.icu" = "http://localhost:${toString config.services.default-creds.port}"; services.cloudflared.tunnels."${config.var.tunnelId}".ingress."default-creds.${config.var.domain}" = "http://localhost:${toString config.services.default-creds.port}";
} }
+1 -1
View File
@@ -22,5 +22,5 @@
inputs.eleakxir.packages.${pkgs.stdenv.hostPlatform.system}.leak-utils inputs.eleakxir.packages.${pkgs.stdenv.hostPlatform.system}.leak-utils
]; ];
services.cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."eleakxir-back.hadi.icu" = "http://localhost:${toString config.services.eleakxir.port}"; services.cloudflared.tunnels."${config.var.tunnelId}".ingress."eleakxir-back.${config.var.domain}" = "http://localhost:${toString config.services.eleakxir.port}";
} }
+3 -3
View File
@@ -31,8 +31,8 @@ in {
server = { server = {
HTTP_ADDR = "127.0.0.1"; HTTP_ADDR = "127.0.0.1";
HTTP_PORT = 3002; HTTP_PORT = 3002;
ROOT_URL = "https://git.hadi.icu/"; ROOT_URL = "https://git.${config.var.domain}/";
DOMAIN = "git.hadi.icu"; DOMAIN = "git.${config.var.domain}";
LANDING_PAGE = "/anotherhadi"; LANDING_PAGE = "/anotherhadi";
}; };
service = { service = {
@@ -58,7 +58,7 @@ in {
}; };
}; };
cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."git.hadi.icu" = "http://localhost:3002"; cloudflared.tunnels."${config.var.tunnelId}".ingress."git.${config.var.domain}" = "http://localhost:3002";
}; };
systemd.services.gitea.preStart = lib.mkAfter '' systemd.services.gitea.preStart = lib.mkAfter ''
+1 -1
View File
@@ -14,7 +14,7 @@
server.port = 5678; server.port = 5678;
}; };
}; };
cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."home.hadi.icu" = "http://localhost:8755"; cloudflared.tunnels."${config.var.tunnelId}".ingress."home.${config.var.domain}" = "http://localhost:8755";
nginx.virtualHosts."glance.local" = { nginx.virtualHosts."glance.local" = {
listen = [ listen = [
+4 -4
View File
@@ -97,11 +97,11 @@
} }
{ {
title = "Mazanoke (image downgrading)"; title = "Mazanoke (image downgrading)";
url = "https://mazanoke.hadi.icu"; url = "https://mazanoke.${config.var.domain}";
} }
{ {
title = "Stirling PDF"; title = "Stirling PDF";
url = "https://pdf.hadi.icu"; url = "https://pdf.${config.var.domain}";
} }
{ {
title = "Vert (file converter)"; title = "Vert (file converter)";
@@ -200,11 +200,11 @@
links = [ links = [
{ {
title = "Nix 4 Cyber"; title = "Nix 4 Cyber";
url = "https://n4c.hadi.icu"; url = "https://n4c.${config.var.domain}";
} }
{ {
title = "Cyberchef"; title = "Cyberchef";
url = "https://cyberchef.hadi.icu"; url = "https://cyberchef.${config.var.domain}";
} }
{ {
title = "TryHackMe"; title = "TryHackMe";
+15 -15
View File
@@ -26,42 +26,42 @@
sites = [ sites = [
{ {
title = "Adguard"; title = "Adguard";
url = "https://adguard.hadi.icu"; url = "https://adguard.${config.var.domain}";
icon = "si:adguard"; icon = "si:adguard";
} }
{ {
title = "Mealie"; title = "Mealie";
url = "https://mealie.hadi.icu"; url = "https://mealie.${config.var.domain}";
icon = "si:mealie"; icon = "si:mealie";
} }
{ {
title = "Linkding"; title = "Linkding";
url = "https://linkding.hadi.icu"; url = "https://linkding.${config.var.domain}";
icon = "sh:linkding"; icon = "sh:linkding";
} }
{ {
title = "Mazanoke"; title = "Mazanoke";
url = "https://mazanoke.hadi.icu"; url = "https://mazanoke.${config.var.domain}";
icon = "sh:mazanoke"; icon = "sh:mazanoke";
} }
{ {
title = "Stirling PDF"; title = "Stirling PDF";
url = "https://pdf.hadi.icu"; url = "https://pdf.${config.var.domain}";
icon = "sh:stirling-pdf"; icon = "sh:stirling-pdf";
} }
{ {
title = "Default-creds"; title = "Default-creds";
url = "https://default-creds.hadi.icu"; url = "https://default-creds.${config.var.domain}";
icon = "si:passbolt"; icon = "si:passbolt";
} }
{ {
title = "Blog"; title = "Blog";
url = "https://hadi.icu"; url = "https://${config.var.domain}";
icon = "si:blogger"; icon = "si:blogger";
} }
{ {
title = "Cyberchef"; title = "Cyberchef";
url = "https://cyberchef.hadi.icu"; url = "https://cyberchef.${config.var.domain}";
icon = "si:codechef"; icon = "si:codechef";
} }
]; ];
@@ -73,37 +73,37 @@
sites = [ sites = [
{ {
title = "Jellyfin"; title = "Jellyfin";
url = "https://media.hadi.icu"; url = "https://media.${config.var.domain}";
icon = "si:jellyfin"; icon = "si:jellyfin";
} }
{ {
title = "Jellyseerr"; title = "Jellyseerr";
url = "https://demandemedia.hadi.icu"; url = "https://demandemedia.${config.var.domain}";
icon = "si:odysee"; icon = "si:odysee";
} }
{ {
title = "Radarr"; title = "Radarr";
url = "https://radarr.hadi.icu"; url = "https://radarr.${config.var.domain}";
icon = "si:radarr"; icon = "si:radarr";
} }
{ {
title = "Sonarr"; title = "Sonarr";
url = "https://sonarr.hadi.icu"; url = "https://sonarr.${config.var.domain}";
icon = "si:sonarr"; icon = "si:sonarr";
} }
{ {
title = "Bazarr"; title = "Bazarr";
url = "https://bazarr.hadi.icu"; url = "https://bazarr.${config.var.domain}";
icon = "si:subtitleedit"; icon = "si:subtitleedit";
} }
{ {
title = "Prowlarr"; title = "Prowlarr";
url = "https://prowlarr.hadi.icu"; url = "https://prowlarr.${config.var.domain}";
icon = "si:podcastindex"; icon = "si:podcastindex";
} }
{ {
title = "Transmission"; title = "Transmission";
url = "https://transmission.hadi.icu"; url = "https://transmission.${config.var.domain}";
icon = "si:transmission"; icon = "si:transmission";
} }
]; ];
+6 -2
View File
@@ -1,5 +1,9 @@
# Mazanoke is a self-hosted image downgrader # Mazanoke is a self-hosted image downgrader
{pkgs, ...}: let {
config,
pkgs,
...
}: let
version = "1.1.5"; version = "1.1.5";
mazanoke-pkg = pkgs.stdenv.mkDerivation { mazanoke-pkg = pkgs.stdenv.mkDerivation {
inherit version; inherit version;
@@ -30,6 +34,6 @@ in {
} }
]; ];
}; };
cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."mazanoke.hadi.icu" = "http://localhost:8755"; cloudflared.tunnels."${config.var.tunnelId}".ingress."mazanoke.${config.var.domain}" = "http://localhost:8755";
}; };
} }
+1 -1
View File
@@ -5,5 +5,5 @@
port = 8092; port = 8092;
}; };
services.cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."mealie.hadi.icu" = "http://localhost:${toString config.services.mealie.port}"; services.cloudflared.tunnels."${config.var.tunnelId}".ingress."mealie.${config.var.domain}" = "http://localhost:${toString config.services.mealie.port}";
} }
+1 -1
View File
@@ -18,5 +18,5 @@ in {
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPG9SE80ZyBcXZK/f5ypSKudaM5Jo3XtQikCnGo0jI5E hadi@nixy" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPG9SE80ZyBcXZK/f5ypSKudaM5Jo3XtQikCnGo0jI5E hadi@nixy"
]; ];
services.cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."ssh.hadi.icu" = "ssh://localhost:22"; services.cloudflared.tunnels."${config.var.tunnelId}".ingress."ssh.${config.var.domain}" = "ssh://localhost:22";
} }
+1 -1
View File
@@ -5,5 +5,5 @@
environment."SERVER_PORT" = "8083"; environment."SERVER_PORT" = "8083";
}; };
services.cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."pdf.hadi.icu" = "http://localhost:${toString config.services.stirling-pdf.environment.SERVER_PORT}"; services.cloudflared.tunnels."${config.var.tunnelId}".ingress."pdf.${config.var.domain}" = "http://localhost:${toString config.services.stirling-pdf.environment.SERVER_PORT}";
} }
+2 -2
View File
@@ -13,9 +13,9 @@
DISABLE_BOT_CHECK = true; DISABLE_BOT_CHECK = true;
}; };
}; };
services.cloudflared.tunnels."a1dfa315-7fc3-4a65-8c02-8387932c35c3".ingress."umami.hadi.icu" = "http://localhost:${toString config.services.umami.settings.PORT}"; services.cloudflared.tunnels."${config.var.tunnelId}".ingress."umami.${config.var.domain}" = "http://localhost:${toString config.services.umami.settings.PORT}";
systemd.services.default-creds.environment = { systemd.services.default-creds.environment = {
PUBLIC_UMAMI_URL = "https://umami.hadi.icu"; PUBLIC_UMAMI_URL = "https://umami.${config.var.domain}";
# FIXME: # FIXME:
PUBLIC_UMAMI_WEBSITE_ID = "7197484c-01ad-488e-9caa-5ab7b7595f08"; PUBLIC_UMAMI_WEBSITE_ID = "7197484c-01ad-488e-9caa-5ab7b7595f08";
UMAMI_URL = "http://localhost:8097"; UMAMI_URL = "http://localhost:8097";