2022-06-03 10:53:10 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchFromGitHub
|
|
|
|
, sunwait
|
|
|
|
, wallutils
|
|
|
|
}:
|
|
|
|
|
2023-09-21 20:38:24 +00:00
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
2022-06-03 10:53:10 +00:00
|
|
|
pname = "sunpaper";
|
2023-02-13 08:19:14 +00:00
|
|
|
version = "2.0";
|
2022-06-03 10:53:10 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hexive";
|
|
|
|
repo = "sunpaper";
|
2023-09-21 20:38:24 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-8s7SS79wCS0nRR7IpkshP5QWJqqKEeBu6EtFPDM+2cM=";
|
2022-06-03 10:53:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
sunwait
|
2023-09-21 20:38:24 +00:00
|
|
|
wallutils
|
2022-06-03 10:53:10 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace sunpaper.sh \
|
2023-09-21 20:38:24 +00:00
|
|
|
--replace "sunwait" "${lib.getExe sunwait}" \
|
|
|
|
--replace "setwallpaper" "${lib.getExe' wallutils "setwallpaper"}" \
|
2022-06-03 10:53:10 +00:00
|
|
|
--replace '$HOME/sunpaper/images/' "$out/share/sunpaper/images/"
|
2023-07-25 20:36:03 +00:00
|
|
|
'';
|
2022-06-03 10:53:10 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2023-09-21 20:38:24 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm555 sunpaper.sh $out/bin/sunpaper
|
|
|
|
mkdir -p "$out/share/sunpaper/images"
|
2022-06-03 10:53:10 +00:00
|
|
|
cp -R images $out/share/sunpaper/
|
2023-09-21 20:38:24 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2022-06-03 10:53:10 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/sunpaper --help > /dev/null
|
|
|
|
'';
|
|
|
|
|
2023-09-21 20:38:24 +00:00
|
|
|
meta = {
|
2022-06-03 10:53:10 +00:00
|
|
|
description = "A utility to change wallpaper based on local weather, sunrise and sunset times";
|
|
|
|
homepage = "https://github.com/hexive/sunpaper";
|
2023-09-21 20:38:24 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
mainProgram = "sunpaper";
|
|
|
|
maintainers = with lib.maintainers; [ eclairevoyant jevy ];
|
|
|
|
platforms = lib.platforms.linux;
|
2022-06-03 10:53:10 +00:00
|
|
|
};
|
2023-09-21 20:38:24 +00:00
|
|
|
})
|