nixpkgs/pkgs/misc/brightnessctl/default.nix
Michael Weiss cf5dd2623b
brightnessctl: Add systemd support
This makes it possible to use brightnessctl without udev rules / suid.
2020-02-09 23:52:32 +01:00

34 lines
1002 B
Nix

{ stdenv, fetchFromGitHub, coreutils, pkg-config, systemd }:
stdenv.mkDerivation rec {
pname = "brightnessctl";
version = "0.5.1";
src = fetchFromGitHub {
owner = "Hummer12007";
repo = "brightnessctl";
rev = version;
sha256 = "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq";
};
makeFlags = [ "PREFIX=" "DESTDIR=$(out)" "ENABLE_SYSTEMD=1" ];
postPatch = ''
substituteInPlace 90-brightnessctl.rules --replace /bin/ ${coreutils}/bin/
# For backward compatibility with the NixOS module / udev approach:
substituteInPlace Makefile --replace "INSTALL_UDEV_RULES=0" "INSTALL_UDEV_RULES=1"
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [ systemd ];
meta = with stdenv.lib; {
homepage = "https://github.com/Hummer12007/brightnessctl";
description = "This program allows you read and control device brightness";
license = licenses.mit;
maintainers = with maintainers; [ megheaiulian ];
platforms = platforms.linux;
};
}