2024-06-20 14:57:18 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitLab
|
|
|
|
, buildGoModule
|
|
|
|
, scdoc
|
|
|
|
, nix-update-script
|
|
|
|
}:
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "darkman";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "2.0.1";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "WhyNotHugo";
|
|
|
|
repo = "darkman";
|
|
|
|
rev = "v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
sha256 = "sha256-FaEpVy/0PqY5Bmw00hMyFZb9wcwYwEuCKMatYN8Xk3o=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
patches = [
|
|
|
|
./go-mod.patch
|
|
|
|
./makefile.patch
|
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace darkman.service \
|
2024-06-20 14:57:18 +00:00
|
|
|
--replace-fail /usr/bin/darkman $out/bin/darkman
|
2022-09-09 14:08:57 +00:00
|
|
|
substituteInPlace contrib/dbus/nl.whynothugo.darkman.service \
|
2024-06-20 14:57:18 +00:00
|
|
|
--replace-fail /usr/bin/darkman $out/bin/darkman
|
2022-09-09 14:08:57 +00:00
|
|
|
substituteInPlace contrib/dbus/org.freedesktop.impl.portal.desktop.darkman.service \
|
2024-06-20 14:57:18 +00:00
|
|
|
--replace-fail /usr/bin/darkman $out/bin/darkman
|
2022-09-09 14:08:57 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
vendorHash = "sha256-3lILSVm7mtquCdR7+cDMuDpHihG+gDJTcQa1cM2o7ZU=";
|
|
|
|
nativeBuildInputs = [ scdoc ];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
make build
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2024-06-20 14:57:18 +00:00
|
|
|
install -Dm755 darkman -t $out/bin
|
2022-09-09 14:08:57 +00:00
|
|
|
make PREFIX=$out install
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
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 ];
|
2022-11-21 17:40:18 +00:00
|
|
|
platforms = platforms.linux;
|
2023-11-16 04:20:00 +00:00
|
|
|
mainProgram = "darkman";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
}
|