2019-10-24 13:54:40 +01:00
|
|
|
{ stdenv, fetchFromGitHub, coreutils, pkg-config, systemd }:
|
2018-06-16 23:15:42 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "brightnessctl";
|
2020-02-06 05:21:26 +00:00
|
|
|
version = "0.5.1";
|
2018-06-16 23:15:42 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Hummer12007";
|
|
|
|
repo = "brightnessctl";
|
2019-09-09 00:38:31 +01:00
|
|
|
rev = version;
|
2020-02-06 05:21:26 +00:00
|
|
|
sha256 = "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq";
|
2018-06-16 23:15:42 +01:00
|
|
|
};
|
|
|
|
|
2019-10-24 13:54:40 +01:00
|
|
|
makeFlags = [ "PREFIX=" "DESTDIR=$(out)" "ENABLE_SYSTEMD=1" ];
|
2018-06-16 23:15:42 +01:00
|
|
|
|
2018-08-10 18:43:07 +01:00
|
|
|
postPatch = ''
|
2018-06-16 23:15:42 +01:00
|
|
|
substituteInPlace 90-brightnessctl.rules --replace /bin/ ${coreutils}/bin/
|
2019-10-24 13:54:40 +01:00
|
|
|
# For backward compatibility with the NixOS module / udev approach:
|
|
|
|
substituteInPlace Makefile --replace "INSTALL_UDEV_RULES=0" "INSTALL_UDEV_RULES=1"
|
2018-06-16 23:15:42 +01:00
|
|
|
'';
|
|
|
|
|
2019-10-24 13:54:40 +01:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
buildInputs = [ systemd ];
|
|
|
|
|
2018-11-01 09:08:43 +00:00
|
|
|
meta = with stdenv.lib; {
|
2018-06-16 23:15:42 +01:00
|
|
|
homepage = "https://github.com/Hummer12007/brightnessctl";
|
|
|
|
description = "This program allows you read and control device brightness";
|
2018-11-01 09:08:43 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ megheaiulian ];
|
|
|
|
platforms = platforms.linux;
|
2018-06-16 23:15:42 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|