From 6142dcd24f7970e7daf09b90645a54357624bd7b Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Fri, 3 Jul 2026 00:30:11 +0200 Subject: [PATCH] Download my video wallpaper by making it (technically) a package --- home/doggo/doggo.nix | 10 +++++++++- home/doggo/hyprland-config.nix | 24 +++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/home/doggo/doggo.nix b/home/doggo/doggo.nix index f9f2cce..9aa3ce8 100644 --- a/home/doggo/doggo.nix +++ b/home/doggo/doggo.nix @@ -57,7 +57,6 @@ in }) (functions.mkUnstable ani-cli) anime4k - yt-dlp jetbrains.idea jetbrains.clion #androidStudioPackages.canary.full @@ -149,6 +148,15 @@ in text_outline = true; }; }; + + yt-dlp = { + enable = true; + settings = { + embed-thumbnail = true; + add-metadata = true; + format = "bestvideo+251/best"; + }; + }; }; home.stateVersion = "26.11"; diff --git a/home/doggo/hyprland-config.nix b/home/doggo/hyprland-config.nix index 5cceb2f..9d59e19 100644 --- a/home/doggo/hyprland-config.nix +++ b/home/doggo/hyprland-config.nix @@ -15,9 +15,31 @@ let find_monitor = id: "$(hyprctl monitors -j | jq -r '.[] | select(.id==${builtins.toString id}) | .name')"; + mkVideoWallpaper = id: hash: + "${(pkgs.stdenv.mkDerivation { + name = "doggo-video-wallpaper-${id}"; + + buildInputs = [ pkgs.yt-dlp ]; + + outputHashMode = "recursive"; + outputHashAlgo = "blake3"; + outputHash = hash; # lib.fakeHash doesn't work for blake3 so I'll have to pass empty strings to find the hashes easily + + buildCommand = '' + cd $out + + yt-dlp \ + -f "bestvideo[ext=mp4]+251/best[ext=mp4]" \ + --no-playlist \ + --audio-quality 0 \ + -o "wallpaper.mp4" \ + "https://www.youtube.com/watch?v=${id}" + ''; + })}/wallpaper.mp4"; + backgrounds_commands = [ "swaybg -i '${./backgrounds/ubuntu_budgie_wallpaper1.jpg}' -o ${find_monitor 0}" - "murale '/disk2/MemoryRebootHatsune&Shrek.avi' -o ${find_monitor 1} --mpv-options '${mpv_options}'" # TODO: Make nixtamal download it with yt-dlp + "murale ${mkVideoWallpaper "ketQTGwA4Lo" "blake3-yvuyjhbBTCqhsxmrjXE3cccC/F+8MisTCpnH+2v8h9w="} -o ${find_monitor 1} --mpv-options '${mpv_options}'" ]; # Start(/stop) my backgrounds on (un)plug