nixpkgs/pkgs/by-name/su/sunpaper/package.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

56 lines
1.2 KiB
Nix

{ lib
, stdenvNoCC
, fetchFromGitHub
, sunwait
, wallutils
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "sunpaper";
version = "2.0";
src = fetchFromGitHub {
owner = "hexive";
repo = "sunpaper";
rev = "v${finalAttrs.version}";
hash = "sha256-8s7SS79wCS0nRR7IpkshP5QWJqqKEeBu6EtFPDM+2cM=";
};
buildInputs = [
sunwait
wallutils
];
postPatch = ''
substituteInPlace sunpaper.sh \
--replace "sunwait" "${lib.getExe sunwait}" \
--replace "setwallpaper" "${lib.getExe' wallutils "setwallpaper"}" \
--replace '$HOME/sunpaper/images/' "$out/share/sunpaper/images/"
'';
installPhase = ''
runHook preInstall
install -Dm555 sunpaper.sh $out/bin/sunpaper
mkdir -p "$out/share/sunpaper/images"
cp -R images $out/share/sunpaper/
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/sunpaper --help > /dev/null
'';
meta = {
description = "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;
};
})