nixpkgs/pkgs/by-name/da/darkman/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

60 lines
1.4 KiB
Nix

{ lib
, fetchFromGitLab
, buildGoModule
, scdoc
, nix-update-script
}:
buildGoModule rec {
pname = "darkman";
version = "2.0.1";
src = fetchFromGitLab {
owner = "WhyNotHugo";
repo = "darkman";
rev = "v${version}";
hash = "sha256-FaEpVy/0PqY5Bmw00hMyFZb9wcwYwEuCKMatYN8Xk3o=";
};
patches = [
./go-mod.patch
./makefile.patch
];
postPatch = ''
substituteInPlace darkman.service \
--replace-fail /usr/bin/darkman $out/bin/darkman
substituteInPlace contrib/dbus/nl.whynothugo.darkman.service \
--replace-fail /usr/bin/darkman $out/bin/darkman
substituteInPlace contrib/dbus/org.freedesktop.impl.portal.desktop.darkman.service \
--replace-fail /usr/bin/darkman $out/bin/darkman
'';
vendorHash = "sha256-3lILSVm7mtquCdR7+cDMuDpHihG+gDJTcQa1cM2o7ZU=";
nativeBuildInputs = [ scdoc ];
buildPhase = ''
runHook preBuild
make build
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 darkman -t $out/bin
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";
};
}