File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 inputs = {
33 nixpkgs . url = "github:NixOS/nixpkgs/nixos-24.11" ;
4+ nixpkgs-ytdl-sub . url = "github:NixOS/nixpkgs/pull/369990/merge" ; # https://github.com/NixOS/nixpkgs/pull/369990
45 deploy-sh . url = "github:Defelo/deploy-sh" ;
56 sops-nix . url = "github:Mic92/sops-nix" ;
67 nfnix . url = "github:Defelo/nfnix" ;
Original file line number Diff line number Diff line change 1010 ./nginx.nix
1111 ./restic.nix
1212 ./wireguard.nix
13+ ./youtube-downloads.nix
1314 ] ;
1415
1516 filesystems . defaultLayout = true ;
Original file line number Diff line number Diff line change 1+ {
2+ inputs ,
3+ pkgs-ytdl-sub ,
4+ ...
5+ } : let
6+ inherit ( inputs ) nixpkgs-ytdl-sub ;
7+ inherit ( pkgs-ytdl-sub ) ytdl-sub ;
8+ in {
9+ imports = [ "${ nixpkgs-ytdl-sub } /nixos/modules/services/misc/ytdl-sub.nix" ] ;
10+
11+ services . sshfs . mounts . "/mnt/youtube" = {
12+ host = "u381435.your-storagebox.de" ;
13+ port = 23 ;
14+ user = "u381435" ;
15+ path = "youtube" ;
16+ readOnly = false ;
17+ allowOther = true ;
18+ } ;
19+
20+ services . ytdl-sub . package = ytdl-sub ;
21+ services . ytdl-sub . instances . default = {
22+ enable = true ;
23+ schedule = null ; # TODO
24+
25+ config = {
26+ presets . "YouTube Playlist" = {
27+ preset = [ "Max 480p" ] ; # TODO
28+ download = "{subscription_value}" ;
29+ output_options = {
30+ output_directory = "/mnt/youtube" ;
31+ file_name = "{subscription_name}/{playlist_index_padded}_{%sanitize(title)}.{ext}" ;
32+ maintain_download_archive = true ;
33+ } ;
34+ ytdl_options = {
35+ cookiefile = "/var/lib/ytdl-sub/default/.cookies" ;
36+ } ;
37+ } ;
38+ } ;
39+
40+ subscriptions . "YouTube Playlist" = {
41+ rust = "https://www.youtube.com/playlist?list=PLNmsVeXQZj7r4HuTyVCDLKlsD9EQzoncP" ;
42+ quantencomputer = "https://www.youtube.com/playlist?list=PLNmsVeXQZj7qS21FP5tk1QqmeAmd2hpQF" ;
43+ clean_code = "https://www.youtube.com/playlist?list=PLNmsVeXQZj7ryyZikMDPxxyYxEKtKn0ji" ;
44+ } ;
45+ } ;
46+
47+ systemd . services . ytdl-sub-default . serviceConfig . ReadWritePaths = [ "/mnt/youtube" ] ;
48+ }
You can’t perform that action at this time.
0 commit comments