From 2d0c946fe33aeed888849909f742bf51148d0946 Mon Sep 17 00:00:00 2001 From: Lucy Hochkamp Date: Sun, 17 Aug 2025 17:17:13 +0200 Subject: [PATCH] yt-dl sub --- hosts/ds9/default.nix | 25 +++++----- hosts/ds9/ytdl-sub.nix | 101 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 12 deletions(-) create mode 100644 hosts/ds9/ytdl-sub.nix diff --git a/hosts/ds9/default.nix b/hosts/ds9/default.nix index f824d20f..24165835 100644 --- a/hosts/ds9/default.nix +++ b/hosts/ds9/default.nix @@ -21,6 +21,7 @@ in ./maubot.nix ./woodpecker.nix ./attic.nix + ./ytdl-sub.nix ../../nixos-modules/networking/tailscale.nix ../../nixos-modules/services/docker.nix @@ -90,18 +91,18 @@ in # Immutable users due to tmpfs users.mutableUsers = false; - users.users.nia = { - createHome = true; - isNormalUser = true; - extraGroups = [ - "docker" - "podman" - "wheel" - ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDq+jk1Bi8/x0lYDiVi/iVnp9nEleocoQ+xHmlpDt9Qs" - ]; - }; + # users.users.nia = { + # createHome = true; + # isNormalUser = true; + # extraGroups = [ + # "docker" + # "podman" + # "wheel" + # ]; + # openssh.authorizedKeys.keys = [ + # "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDq+jk1Bi8/x0lYDiVi/iVnp9nEleocoQ+xHmlpDt9Qs" + # ]; + # }; users.users.bzzt = { description = "bzzt server service user"; home = "/var/lib/bzzt"; diff --git a/hosts/ds9/ytdl-sub.nix b/hosts/ds9/ytdl-sub.nix new file mode 100644 index 00000000..94a5248e --- /dev/null +++ b/hosts/ds9/ytdl-sub.nix @@ -0,0 +1,101 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: +let + channels = [ + "WilliamOsman2" + "TechnologyConnections" + "GarbageTime420" + "LinusTechTips" + "gabe.follower" + "TheB1M" + "2BoredGuysOfficial" + "DankPods" + "Ididathing" + "Boy_Boy" + "TylerMcVicker1" + "PosyMusic" + "jameshoffmann" + "NoBoilerplate" + "Parabelritter" + "TomScottGo" + "f4micom" + "DeviantOllam" + "styropyro" + "Defunctland" + "BenEater" + "stacksmashing" + "ZackFreedman" + "MaxMakerChannel" + "agingwheels" + "PhilosophyTube" + "Nerdforge" + "AlexPrinz" + "MaxFosh" + "BagelBoyOfficial" + "hbomberguy" + "ContraPoints" + "RobBubble" + "standupmaths" + "theCodyReeder" + "NileRed" + "NileBlue" + "TechnologyConnextras" + "simonegiertz" + "billwurtz" + "MichaelReeves" + "williamosman" + "iliketomakestuff" + "altf4games" + "DIYPerks" + ]; +in + +{ + systemd.services."ytdl-sub-default".serviceConfig.ReadWritePaths = ["/data/media/yt"]; + services.ytdl-sub = { + instances.default = { + enable = true; + schedule = "0/6:0"; + config = { + presets."TV Show" = { + ytdl_options.cookiefile = "/data/media/yt/cookies.Personal.txt"; + subtitles = { + embed_subtitles = true; + languages = [ + "en" + "de" + ]; + allow_auto_generated_subtitles = false; + }; + chapters = { + sponsorblock_categories = [ + "sponsor" + "selfpromo" + ]; + + remove_sponsorblock_categories = "all"; + }; + }; + }; + subscriptions = { + "__preset__".overrides.tv_show_directory = "/data/media/yt"; + "Jellyfin TV Show by Date | Only Recent | Max 1080p" = builtins.listToAttrs ( + builtins.map (x: { + name = x; + value = "https://youtube.com/@${x}"; + }) channels + ); + "Jellyfin TV Show Collection" = { + "Murder Drones" = "https://www.youtube.com/playlist?list=PLHovnlOusNLiJz3sm0d5i2Evwa2LDLdrg"; + }; + }; + }; + group = "users"; + + }; +}