2024-06-05 15:33:14 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitLab
|
|
|
|
, buildGoModule
|
|
|
|
, scdoc
|
|
|
|
, nix-update-script
|
|
|
|
}:
|
2022-08-24 22:15:39 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "darkman";
|
2024-06-05 15:33:14 +00:00
|
|
|
version = "2.0.1";
|
2022-08-24 22:15:39 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "WhyNotHugo";
|
|
|
|
repo = "darkman";
|
|
|
|
rev = "v${version}";
|
2024-07-13 13:27:47 +00:00
|
|
|
hash = "sha256-FaEpVy/0PqY5Bmw00hMyFZb9wcwYwEuCKMatYN8Xk3o=";
|
2022-08-24 22:15:39 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:33:14 +00:00
|
|
|
patches = [
|
|
|
|
./go-mod.patch
|
|
|
|
./makefile.patch
|
|
|
|
];
|
2022-08-24 22:15:39 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace darkman.service \
|
2024-06-05 15:33:14 +00:00
|
|
|
--replace-fail /usr/bin/darkman $out/bin/darkman
|
2022-08-24 22:15:39 +00:00
|
|
|
substituteInPlace contrib/dbus/nl.whynothugo.darkman.service \
|
2024-06-05 15:33:14 +00:00
|
|
|
--replace-fail /usr/bin/darkman $out/bin/darkman
|
2022-08-24 22:15:39 +00:00
|
|
|
substituteInPlace contrib/dbus/org.freedesktop.impl.portal.desktop.darkman.service \
|
2024-06-05 15:33:14 +00:00
|
|
|
--replace-fail /usr/bin/darkman $out/bin/darkman
|
2022-08-24 22:15:39 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:33:14 +00:00
|
|
|
vendorHash = "sha256-3lILSVm7mtquCdR7+cDMuDpHihG+gDJTcQa1cM2o7ZU=";
|
|
|
|
nativeBuildInputs = [ scdoc ];
|
|
|
|
|
2022-08-24 22:15:39 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
make build
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2024-06-05 15:33:14 +00:00
|
|
|
install -Dm755 darkman -t $out/bin
|
2022-08-24 22:15:39 +00:00
|
|
|
make PREFIX=$out install
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-12-25 22:11:14 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2022-08-24 22:15:39 +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-14 10:44:34 +00:00
|
|
|
platforms = platforms.linux;
|
2023-10-22 18:58:36 +00:00
|
|
|
mainProgram = "darkman";
|
2022-08-24 22:15:39 +00:00
|
|
|
};
|
|
|
|
}
|