2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchFromGitHub
|
|
|
|
, sunwait
|
|
|
|
, wallutils
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation rec {
|
|
|
|
pname = "sunpaper";
|
2023-02-16 17:41:37 +00:00
|
|
|
version = "2.0";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hexive";
|
|
|
|
repo = "sunpaper";
|
2023-02-16 17:41:37 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-8s7SS79wCS0nRR7IpkshP5QWJqqKEeBu6EtFPDM+2cM=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
wallutils
|
|
|
|
sunwait
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace sunpaper.sh \
|
|
|
|
--replace "sunwait" "${sunwait}/bin/sunwait" \
|
|
|
|
--replace "setwallpaper" "${wallutils}/bin/setwallpaper" \
|
|
|
|
--replace '$HOME/sunpaper/images/' "$out/share/sunpaper/images/"
|
2023-08-04 22:07:22 +00:00
|
|
|
'';
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/bin" "$out/share/sunpaper/images"
|
|
|
|
cp sunpaper.sh $out/bin/sunpaper
|
|
|
|
cp -R images $out/share/sunpaper/
|
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/sunpaper --help > /dev/null
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A utility to change wallpaper based on local weather, sunrise and sunset times";
|
|
|
|
homepage = "https://github.com/hexive/sunpaper";
|
|
|
|
license = lib.licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ jevy ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|