depot/third_party/nixpkgs/pkgs/tools/X11/sunpaper/default.nix
Default email 5e9e1146e1 Project import generated by Copybara.
GitOrigin-RevId: 18036c0be90f4e308ae3ebcab0e14aae0336fe42
2023-08-05 00:07:22 +02:00

50 lines
1.1 KiB
Nix

{ lib
, stdenvNoCC
, fetchFromGitHub
, sunwait
, wallutils
}:
stdenvNoCC.mkDerivation rec {
pname = "sunpaper";
version = "2.0";
src = fetchFromGitHub {
owner = "hexive";
repo = "sunpaper";
rev = "v${version}";
sha256 = "sha256-8s7SS79wCS0nRR7IpkshP5QWJqqKEeBu6EtFPDM+2cM=";
};
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/"
'';
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;
};
}