24 lines
569 B
Nix
24 lines
569 B
Nix
{ stdenv, fetchurl, imagemagick }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "sway-background-image";
|
|
version = "0.1";
|
|
|
|
src = fetchurl {
|
|
url = "https://images.unsplash.com/photo-1541701494587-cb58502866ab";
|
|
hash = "sha256-qFD7FFqY2l2Fsev/YPu1/f7f29BntxsO1ezJj2BlMs8=";
|
|
};
|
|
|
|
dontUnpack = true;
|
|
|
|
nativeBuildInputs = [ imagemagick ];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
mkdir -p $out/share
|
|
# significantly reduces image size, 4.8MiB -> 1.7MiB
|
|
convert -quality 90 -resize 4096x $src $out/share/background.jpg
|
|
runHook postInstall
|
|
'';
|
|
}
|