Download my video wallpaper by making it (technically) a package

This commit is contained in:
Username404-59 2026-07-03 00:30:11 +02:00
parent b09795ebd6
commit 6142dcd24f
Signed by: Username404-59
GPG Key ID: F3A1878B14F5F0D7
2 changed files with 32 additions and 2 deletions

View File

@ -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";

View File

@ -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