home/wallpapers/summer.jpg: crop black bars

This commit is contained in:
Guanran Wang 2024-02-13 14:02:33 +08:00
parent 53b4f1c94b
commit 5d709ee9b6
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8

View file

@ -1,4 +1,8 @@
{pkgs, ...}: let
{
lib,
pkgs,
...
}: let
# curlOpts for pixiv, or it returns 403.
curlOptsList = ["-e" "https://www.pixiv.net/"];
in {
@ -14,11 +18,17 @@ in {
url = "https://i.pximg.net/img-original/img/2023/03/29/01/29/52/106654974_p0.jpg"; # https://www.pixiv.net/en/artworks/106654974
hash = "sha256-mB/D46JCddOlMUtFQu7R0OtRMIoApbT1nnRv0VyzEb8=";
};
"backgrounds/summer.jpg".source = pkgs.fetchurl {
"backgrounds/summer.jpg".source = let
image = pkgs.fetchurl {
inherit curlOptsList;
url = "https://i.pximg.net/img-original/img/2015/04/23/12/43/35/49983419_p0.jpg"; # https://www.pixiv.net/en/artworks/49983419
hash = "sha256-JZ5VmsjVjZfHXpx3JxzAyYzZppZmgH38AiAA+B0TDiw=";
};
in
# Crop 100px on top and bottom
pkgs.runCommandNoCC "49983419_p0.jpg" {} ''
${lib.getExe pkgs.imagemagick} convert ${image} -crop 3500x1600+0+100 $out
'';
"backgrounds/macos-mojave-day.jpg".source = pkgs.fetchurl {
url = "https://media.idownloadblog.com/wp-content/uploads/2018/06/macOS-Mojave-Day-wallpaper.jpg";
hash = "sha256-DtIaO7jWkhdU4EqJL8QfAaaajRcME79/O8szk1po/Go=";