nixpkgs/pkgs/by-name/su/sunpaper/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.2 KiB
Nix
Raw Normal View History

2022-06-03 10:53:10 +00:00
{ lib
, stdenvNoCC
, fetchFromGitHub
, sunwait
, wallutils
}:
stdenvNoCC.mkDerivation (finalAttrs: {
2022-06-03 10:53:10 +00:00
pname = "sunpaper";
version = "2.0";
2022-06-03 10:53:10 +00:00
src = fetchFromGitHub {
owner = "hexive";
repo = "sunpaper";
rev = "v${finalAttrs.version}";
hash = "sha256-8s7SS79wCS0nRR7IpkshP5QWJqqKEeBu6EtFPDM+2cM=";
2022-06-03 10:53:10 +00:00
};
buildInputs = [
sunwait
wallutils
2022-06-03 10:53:10 +00:00
];
postPatch = ''
substituteInPlace sunpaper.sh \
--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 = ''
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/
runHook postInstall
2022-06-03 10:53:10 +00:00
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/sunpaper --help > /dev/null
'';
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";
license = lib.licenses.asl20;
mainProgram = "sunpaper";
maintainers = with lib.maintainers; [ eclairevoyant jevy ];
platforms = lib.platforms.linux;
2022-06-03 10:53:10 +00:00
};
})