nixpkgs/pkgs/by-name/gu/gummy/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

85 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchFromGitea,
testers,
cmake,
libX11,
libXext,
sdbus-cpp,
udev,
xcbutilimage,
coreutils,
cli11,
ddcutil,
fmt,
nlohmann_json,
spdlog,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gummy";
version = "0.6.1";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "fusco";
repo = "gummy";
rev = finalAttrs.version;
hash = "sha256-ic+kTBoirMX6g79NdNoeFbNNo1LYg/z+nlt/GAB6UyQ=";
};
nativeBuildInputs = [
cmake
];
buildInputs = [
cli11
ddcutil
fmt
libX11
libXext
nlohmann_json
sdbus-cpp
spdlog
udev
xcbutilimage
];
cmakeFlags = [
(lib.mapAttrsToList lib.cmakeFeature {
"UDEV_DIR" = "${placeholder "out"}/lib/udev";
"UDEV_RULES_DIR" = "${placeholder "out"}/lib/udev/rules.d";
})
];
# Fixes the "gummy start" command, without this it cannot find the binary.
# Setting this through cmake does not seem to work.
postPatch = ''
substituteInPlace gummyd/gummyd/api.cpp \
--replace "CMAKE_INSTALL_DAEMON_PATH" "\"${placeholder "out"}/libexec/gummyd\""
'';
preFixup = ''
substituteInPlace $out/lib/udev/rules.d/99-gummy.rules \
--replace "/bin/chmod" "${coreutils}/bin/chmod"
ln -s $out/libexec/gummyd $out/bin/gummyd
'';
passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
passthru.updateScript = nix-update-script { };
meta = with lib; {
homepage = "https://codeberg.org/fusco/gummy";
description = "Brightness and temperature manager for X11";
longDescription = ''
CLI screen manager for X11 that allows automatic and manual brightness/temperature adjustments,
via backlight (currently only for embedded displays) and gamma. Multiple monitors are supported.
'';
license = licenses.gpl3Only;
maintainers = [ ];
};
})