{
lib,
fetchFromGitLab,
buildGoModule,
scdoc,
nix-update-script,
...
}: let
hashes = (builtins.import ../hashes.nix).darkman;
in
buildGoModule {
pname = "darkman";
version = "1.5.4-with-bash-fix";
src = fetchFromGitLab {
owner = "WhyNotHugo";
repo = "darkman";
inherit (hashes) rev hash;
};
inherit (hashes) vendorHash;
nativeBuildInputs = [scdoc];
postPatch = ''
substituteInPlace darkman.service \
--replace "/usr/bin/darkman" "$out/bin/darkman"
substituteInPlace contrib/dbus/nl.whynothugo.darkman.service \
substituteInPlace contrib/dbus/org.freedesktop.impl.portal.desktop.darkman.service \
'';
buildPhase = ''
runHook preBuild
make build
runHook postBuild
installPhase = ''
runHook preInstall
make PREFIX=$out install
runHook postInstall
passthru.updateScript = nix-update-script {};
meta = with lib; {
description = "Framework for dark-mode and light-mode transitions on Linux desktop";
homepage = "https://gitlab.com/WhyNotHugo/darkman";
license = licenses.isc;
maintainers = [maintainers.ajgrf];
platforms = platforms.linux;
mainProgram = "darkman";
}