1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/packages/applicative-wallpaper.nix

39 lines
970 B
Nix
Raw Permalink Normal View History

2026-02-10 22:02:34 +01:00
{
runCommand,
fetchurl,
imagemagick,
colors,
}:
let
backgroundColor = colors.withHashtag.base06;
foregroundColor = colors.withHashtag.base01;
width = 1920;
height = 1080;
svgUrl = "https://applicative.systems/_astro/logo-full.D8zRvqBZ.svg";
logoSvg = fetchurl {
url = svgUrl;
hash = "sha256-qXDIEZsAPn4eUJ3kb5U6L3PMUCtWGYqhqyIaBt7FntE=";
};
in
runCommand "applicative-wallpaper.png"
{
nativeBuildInputs = [ imagemagick ];
}
''
# 1. We use -background to set the canvas color
# 2. We use -fuzz and -opaque to replace the logo's internal colors
# 3. We use -gravity and -extent to center it on a wallpaper-sized canvas
convert \
-background none \
-density 300 \
"${logoSvg}" \
-fuzz 100% -fill "${foregroundColor}" -opaque black \
-resize 800x800 \
-gravity center \
-background "${backgroundColor}" \
-extent ${toString width}x${toString height} \
$out
''