crun: 1.8.3 -> 1.8.4
[NixPkgs.git] / pkgs / tools / X11 / sunpaper / default.nix
blob9f760bb4a93fb5b39df0777d95c307f4aaeb285c
1 { lib
2 , stdenvNoCC
3 , fetchFromGitHub
4 , sunwait
5 , wallutils
6 , rPackages
7 }:
9 stdenvNoCC.mkDerivation rec {
10   pname = "sunpaper";
11   version = "2.0";
13   src = fetchFromGitHub {
14     owner = "hexive";
15     repo = "sunpaper";
16     rev = "v${version}";
17     sha256 = "sha256-8s7SS79wCS0nRR7IpkshP5QWJqqKEeBu6EtFPDM+2cM=";
18   };
20   buildInputs = [
21     wallutils
22     sunwait
23   ];
25   postPatch = ''
26     substituteInPlace sunpaper.sh \
27       --replace "sunwait" "${sunwait}/bin/sunwait" \
28       --replace "setwallpaper" "${wallutils}/bin/setwallpaper" \
29       --replace '$HOME/sunpaper/images/' "$out/share/sunpaper/images/"
30     '';
32   installPhase = ''
33     mkdir -p "$out/bin" "$out/share/sunpaper/images"
34     cp sunpaper.sh $out/bin/sunpaper
35     cp -R images $out/share/sunpaper/
36   '';
38   doInstallCheck = true;
40   installCheckPhase = ''
41     $out/bin/sunpaper --help > /dev/null
42   '';
44   meta = with lib; {
45     description = "A utility to change wallpaper based on local weather, sunrise and sunset times";
46     homepage = "https://github.com/hexive/sunpaper";
47     license = lib.licenses.unfree;
48     maintainers = with maintainers; [ jevy ];
49     platforms = platforms.unix;
50   };