wip qb setup

This commit is contained in:
Daniel Bulant 2026-04-12 20:13:45 +02:00
parent f12e603497
commit 3fa6ddfb04
No known key found for this signature in database
4 changed files with 237 additions and 172 deletions

View file

@ -1,13 +1,13 @@
font_family Fira Code Retina
font_features FiraCode-Retina +zero
background_opacity 0.4
background_opacity 0.6
shell nu
#map ctrl+shift+c copy_to_clipboard
#map ctrl+shift+v paste_from_clipboard
include dank-tabs.conf
tab_bar_edge top
tab_bar_edge bottom
tab_bar_style powerline
tab_powerline_style round
tab_activity_symbol *

View file

@ -1,40 +1,43 @@
{
# config,
nix-index-database,
pkgs,
lib,
name ? "eisen",
# copyparty,
...
}:
let
# these are used both in service configuration but also to
# create mappings {name}.eisen.danbulant.cloud to port in caddy
ports = {
"status" = 3001;
"glance" = 5678;
"jellyfin" = 8096;
# "copyparty" = 3210;
# "syncthing" = 8384;
# "gitea" = 3000;
# "immich" = 2283;
# "grafana" = 3002;
"ntfy" = 3003;
# "suwayomi" = 3004;
status = 3001;
glance = 5678;
jellyfin = 8096;
qb = 8081;
sonarr = 8989;
radarr = 7878;
jackett = 9117;
keep = 8100;
grafana = 3002;
# ntfy = 3003;
};
internalPorts = {
prometheus-node = 9000;
prometheus-qb = 9200;
prometheus-sonarr = 9101;
prometheus-radarr = 9102;
prometheus = 9090;
};
in
{
deployment = {
buildOnTarget = true;
targetHost = "192.168.1.114";
};
# nixpkgs.overlays = [ copyparty.overlays.default ];
programs.nix-index-database.comma.enable = true;
imports = [
nix-index-database.nixosModules.nix-index
# copyparty.nixosModules.default
./hardware-configuration.nix
];
@ -76,45 +79,30 @@ in
enable = true;
};
# syncthing = {
# enable = true;
# openDefaultPorts = true;
# settings = {
# gui = {
# insecureSkipHostCheck = true;
# };
# };
# };
sonarr = {
enable = true;
settings.server.port = ports.sonarr;
};
# copyparty = {
# enable = true;
radarr = {
enable = true;
settings.server.port = ports.radarr;
};
# settings = {
# p = ports.copyparty;
# idp-hm-usr = "^X-Webauth-Login^danbulant@github^dan";
# rproxy = 1;
# xff-hdr = "X-Forwarded-For";
# ipu = [ "100.103.148.81/32=dan" /*"100.79.186.114/32=dan" "100.76.144.133/32=dan" "100.114.62.113/32=dan" */ ];
# };
jackett = {
enable = true;
port = ports.jackett;
};
# accounts = {
# dan = {
# passwordFile = "/dev/null";
# };
# };
# volumes = {
# "/" = {
# path = "/media/large";
# access = {
# rwa = [ "dan" ];
# r = [ "*" ];
# };
# };
# };
# openFilesLimit = 8192;
# };
karakeep = {
enable = true;
extraEnvironment = {
PORT = toString ports.keep;
# DISABLE_SIGNUPS = "true";
DISABLE_NEW_RELEASE_CHECK = "true";
};
environmentFile = "/etc/secrets/karakeep.env";
};
dnsmasq = {
enable = true;
@ -127,35 +115,79 @@ in
};
};
# grafana = {
# enable = true;
# settings.server.http_port = ports.grafana;
# };
# prometheus.enable = true;
# suwayomi-server = {
# enable = true;
# settings.server = {
# port = ports.suwayomi;
# extensionRepos = [
# "https://raw.githubusercontent.com/keiyoushi/extensions/repo/index.min.json"
# ];
# };
# };
# flaresolverr.enable = true;
# immich = {
# enable = true;
# };
ntfy-sh = {
grafana = {
enable = true;
settings = {
listen-http = ":${toString ports.ntfy}";
base-url = "http://ntfy.eisen";
server.http_port = ports.grafana;
security = {
secret_key = "$__file{/etc/secrets/gf_secret_key}";
};
};
};
prometheus = {
enable = true;
exporters = {
exportarr-radarr = {
enable = true;
url = "http://127.0.0.1:${toString ports.radarr}";
port = internalPorts.prometheus-radarr;
apiKeyFile = "/etc/secrets/radarr_api_key";
};
exportarr-sonarr = {
enable = true;
url = "http://127.0.0.1:${toString ports.sonarr}";
port = internalPorts.prometheus-sonarr;
apiKeyFile = "/etc/secrets/sonarr_api_key";
};
node = {
enable = true;
port = internalPorts.prometheus-node;
};
};
scrapeConfigs = [
{
job_name = "node";
static_configs = [
{
targets = [ "localhost:${toString internalPorts.prometheus-node}" ];
}
];
}
{
job_name = "qb";
static_configs = [
{
targets = [ "localhost:${toString internalPorts.prometheus-qb}" ];
}
];
}
{
job_name = "sonarr";
static_configs = [
{
targets = [ "localhost:${toString internalPorts.prometheus-sonarr}" ];
}
];
}
{
job_name = "radarr";
static_configs = [
{
targets = [ "localhost:${toString internalPorts.prometheus-radarr}" ];
}
];
}
];
};
# ntfy-sh = {
# enable = true;
# settings = {
# listen-http = ":${toString ports.ntfy}";
# base-url = "http://ntfy.eisen";
# };
# };
# grafana-to-ntfy = {
# enable = true;
@ -216,9 +248,68 @@ in
};
# systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true";
virtualisation.docker = {
enable = true;
enableOnBoot = true;
virtualisation = {
docker = {
enable = true;
enableOnBoot = true;
};
oci-containers = {
backend = "docker";
containers = {
gluetun = {
image = "qmcgaw/gluetun";
capabilities = {
NET_ADMIN = true;
};
devices = [ "/dev/net/tun" ];
environmentFiles = [ "/etc/secrets/gluetun.env" ];
ports = [
"${toString ports.qb}:${toString ports.qb}"
];
# VPN_SERVICE_PROVIDER=protonvpn
# VPN_TYPE=wireguard
# WIREGUARD_PRIVATE_KEY=wOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU
# SERVER_COUNTRIES=Denmark
environment = {
VPN_PORT_FORWARDING = "on";
# TOR_ONLY = "on";
PORT_FORWARD_ONLY = "on";
FIREWALL_OUTBOUND_SUBNETS = "192.168.1.0/24,100.64.0.0/10";
FIREWALL_INPUT_PORTS = "41641,22,80,443,53";
VPN_PORT_FORWARDING_UP_COMMAND = ''
/bin/sh -c 'wget -O- -nv --retry-connrefused --post-data "json={\"listen_port\":{{PORT}},\"current_network_interface\":\"{{VPN_INTERFACE}}\",\"random_port\":false,\"upnp\":false}" http://172.17.0.1:${toString ports.qb}/api/v2/app/setPreferences'
'';
VPN_PORT_FORWARDING_DOWN_COMMAND = ''
/bin/sh -c 'wget -O- -nv --retry-connrefused --post-data "json={\"listen_port\":0,\"current_network_interface\":\"lo\"}" http://172.17.0.1:${toString ports.qb}/api/v2/app/setPreferences'
'';
};
# extraOptions = [ "--network=host" ];
};
qbittorrent = {
image = "lscr.io/linuxserver/qbittorrent";
environment = {
WEBUI_PORT = toString ports.qb;
};
volumes = [ "/media/large/downloads:/large" ];
extraOptions = [ "--network=container:gluetun" ];
};
prometheus-qb = {
image = "ghcr.io/esanchezm/prometheus-qbittorrent-exporter";
environment = {
QBITTORRENT_PORT = toString ports.qb;
QBITTORRENT_HOST = "localhost";
EXPORTER_PORT = toString internalPorts.prometheus-qb;
};
extraOptions = [ "--network=host" ];
# ports = [ "8000:${toString internalPorts.prometheus-qb}" ];
};
};
};
};
# hardware.nvidia-container-toolkit.enable = true;

View file

@ -10,29 +10,10 @@
"first-day-of-week" = "monday";
}
{
type = "rss";
limit = 10;
"collapse-after" = 3;
cache = "12h";
feeds = [
type = "server-stats";
servers = [
{
url = "https://selfh.st/rss/";
title = "selfh.st";
limit = 4;
}
{
url = "https://ciechanow.ski/atom.xml";
}
{
url = "https://www.joshwcomeau.com/rss.xml";
title = "Josh Comeau";
}
{
url = "https://samwho.dev/rss.xml";
}
{
url = "https://ishadeed.com/feed.xml";
title = "Ahmad Shadeed";
type = "local";
}
];
}
@ -65,7 +46,7 @@
<a class="size-title-dynamic color-highlight text-truncate block grow" href="http://status.eisen/dashboard/{{ $id }}"
target="_blank" rel="noreferrer">
{{ .String "name" }} </a>
{{ if gt (len $hbArray) 0 }}
{{ $latest := index $hbArray (sub (len $hbArray) 1) }}
{{ if eq ($latest.Int "status") 1 }}
@ -116,30 +97,56 @@
];
}
{
type = "videos";
channels = [
"UCXuqSBlHAE6Xw-yeJA0Tunw" # Linus Tech Tips
"UCR-DXc1voovS8nhAvccRZhg" # Jeff Geerling
"UCsBjURrPoezykLs9EqgamOA" # Fireship
"UCBJycsmduvYEL83R_U4JriQ" # Marques Brownlee
"UCHnyfMqiRRG1u-2MsSQLbXA" # Veritasium
];
}
{
type = "group";
widgets = [
type = "monitor";
cache = "1m";
title = "Services";
sites = [
{
type = "reddit";
subreddit = "technology";
"show-thumbnails" = true;
title = "Jellyfin";
url = "http://jellyfin.eisen.danbulant.cloud";
icon = "si:jellyfin";
}
{
type = "reddit";
subreddit = "selfhosted";
"show-thumbnails" = true;
title = "qBittorrent";
url = "http://qb.eisen.danbulant.cloud";
icon = "si:qbittorrent";
}
{
title = "Radarr";
url = "http://radarr.eisen.danbulant.cloud";
icon = "si:radarr";
}
{
title = "Sonarr";
url = "http://sonarr.eisen.danbulant.cloud";
icon = "si:sonarr";
}
{
title = "Vaultwarden";
url = "https://vaultwarden.danbulant.cloud";
icon = "si:vaultwarden";
}
{
title = "Nextcloud";
url = "https://direct.danbulant.cloud";
icon = "si:nextcloud";
}
{
title = "Grafana";
url = "http://grafana.eisen.danbulant.cloud";
icon = "si:grafana";
}
{
title = "Karakeep";
url = "http://keep.eisen.danbulant.cloud";
icon = "si:karakeep";
}
];
}
# {
# type = "docker-containers";
# }
];
}
{
@ -165,57 +172,23 @@
}
{
type = "custom-api";
title = "Epic Games";
cache = "1h";
url = "https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions?locale=en&country=US&allowCountries=US";
title = "Steam specials";
cache = "12h";
url = "https://store.steampowered.com/api/featuredcategories?cc=us";
template = ''
<div>
{{ if eq .Response.StatusCode 200 }}
<div class="horizontal-cards-2">
{{ range .JSON.Array "data.Catalog.searchStore.elements" }}
{{ $price := .String "price.totalPrice.discountPrice" }}
{{ $hasPromo := gt (len (.Array "promotions.promotionalOffers")) 0 }}
{{ if and $hasPromo (eq $price "0") }}
{{ $gamePage := .String "productSlug" }}
{{ if gt (len (.Array "offerMappings")) 0 }}
{{ $gamePage = .String "offerMappings.0.pageSlug" }}
{{end }}
<a href="https://store.epicgames.com/en-US/p/{{ $gamePage }}" target="_blank" class="card">
{{ $title := .String "title" }}
{{ range .Array "keyImages" }}
{{ if eq (.String "type") "OfferImageWide" }}
<img src="{{ .String "url" }}" alt="{{ $title }}" style="width: 100%; max-width: 300px; height: 150px; object-fit: cover; border-radius: var(--border-radius);">
{{ end }}
{{ end }}
<div class="card-content">
<span class="size-base color-primary">{{ $title }}</span><br>
<span class="size-h5 color-subdue">
{{ if $hasPromo }}
{{ $promotions := .Array "promotions.promotionalOffers" }}
{{ if gt (len $promotions) 0 }}
{{ $firstPromo := index $promotions 0 }}
{{ $offers := $firstPromo.Array "promotionalOffers" }}
{{ if gt (len $offers) 0 }}
{{ $firstOffer := index $offers 0 }}
Free until {{ slice ($firstOffer.String "endDate") 0 10 }}
{{ else }}
Free this week!
{{ end }}
{{ else }}
Free this week!
{{ end }}
{{ end }}
</span>
</div>
</a>
{{ end }}
{{ end }}
</div>
{{ else }}
<p class="color-negative">Error fetching Epic Games data.</p>
{{ end }}
</div>
'';
<ul class="list list-gap-10 collapsible-container" data-collapse-after="5">
{{ range .JSON.Array "specials.items" }}
<li>
<a class="size-h4 color-highlight block text-truncate" href="https://store.steampowered.com/app/{{ .Int "id" }}/">{{ .String "name" }}</a>
<ul class="list-horizontal-text">
<li>{{ div (.Int "final_price" | toFloat) 100 | printf "$%.2f" }}</li>
{{ $discount := .Int "discount_percent" }}
<li{{ if ge $discount 40 }} class="color-positive"{{ end }}>{{ $discount }}% off</li>
</ul>
</li>
{{ end }}
</ul>
'';
}
];
}

View file

@ -38,6 +38,7 @@ in
stateVersion = "25.11";
packages = with pkgs; [
ddcutil
unstable.gearlever
linux-wallpaperengine
lmstudio