added Transmission, added VPS-caddy files

This commit is contained in:
Elias Gasparis 2025-04-17 13:52:29 +08:00
parent 66b52e0950
commit 9c6da58b21
8 changed files with 87 additions and 5 deletions

View file

@ -1,15 +1,21 @@
# NixOS - Knossos
Test system.
My test system.
## Goals
- Learn Nix.
- Attempt to make homelab, a la Yunohost...but declarative
- Try to avoid Docker
## Tasks
[ x ] - ZFS root file system
[ x ]- Tailscale --> VPS --> domain name
[ ] - Need an auth system
- [X] ZFS for root file system
- [X] Tailscale
- [ ]--> --> domain name
- [X] Setup Jellyfin
- [X] Setup calibre-web
- [ ] Setup Transmission
- [ ] Setup Nextcloud
- [ ] Setup systemwide auth system - LDAP? OAuth?
## System Information
```

30
VPS-caddy/Caddyfile Normal file
View file

@ -0,0 +1,30 @@
{
email youremail@email.com
}
*.home.mydomain.com {
vars {
# IP address of My Tailscale Server
tailscale_ip 100.0.0.0
}
tls {
dns gandi APIKEYHERE
}
@jellyfin host jellyfin.home.mydomain.com
handle @jellyfin {
reverse_proxy {vars.tailscale_ip}:8096
}
@books host books.home.mydomain.com
handle @books {
reverse_proxy {vars.tailscale_ip}:8083
}
# Fallback for otherwise unhandled domains
handle {
abort
}
}

8
VPS-caddy/Dockerfile Normal file
View file

@ -0,0 +1,8 @@
FROM caddy:2.8.4-builder-alpine AS builder
RUN xcaddy build \
--with github.com/caddy-dns/gandi
FROM caddy:2.8.4-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy

7
VPS-caddy/README.md Normal file
View file

@ -0,0 +1,7 @@
# Run Your Homelab Behind your VPS
https://blog.arkadi.one/p/run-your-homelab-behind-your-vps/
## Files in this directory:
- Dockerfile - to build a custom Caddy executable with gandi registrar module
- docker-compose.yml - to run Caddy
- Caddyfile - your caddy settings for a wildcard DNS

View file

@ -0,0 +1,23 @@
services:
caddy:
build: .
container_name: Caddy
cap_add:
- NET_ADMIN
ports:
- 80:80
- 443:443
- 443:443/udp
env_file:
- secrets.env
volumes:
# I don't like using Docker volumes
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- ./data:/data
- ./config:/config
restart: unless-stopped
networks:
- caddy
networks:
caddy:
name: caddy

View file

@ -15,6 +15,7 @@
./services/calibre-web.nix
./services/glances.nix
./services/fail2ban.nix
./services/transmission.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;

View file

@ -4,6 +4,7 @@
services.jellyfin = {
enable = true;
openFirewall = true;
dataDir = "/var/lib/jellyfin"; #default
};
environment.systemPackages = [

View file

@ -3,9 +3,15 @@
# https://mynixos.com/nixpkgs/options/services.transmission
services.transmission {
services.transmission = {
enable = true;
package = pkgs.transmission_4;
openFirewall = true;
openPeerPorts = true;
openRPCPort = true;
settings = {
rpc-bind-address = "0.0.0.0";
};
};
}