brightnessctl: Add systemd support
This makes it possible to use brightnessctl without udev rules / suid.
This commit is contained in:
parent
2fc3322f32
commit
cf5dd2623b
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchFromGitHub, coreutils }:
|
{ stdenv, fetchFromGitHub, coreutils, pkg-config, systemd }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "brightnessctl";
|
pname = "brightnessctl";
|
||||||
|
@ -11,12 +11,17 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq";
|
sha256 = "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq";
|
||||||
};
|
};
|
||||||
|
|
||||||
makeFlags = [ "PREFIX=" "DESTDIR=$(out)" ];
|
makeFlags = [ "PREFIX=" "DESTDIR=$(out)" "ENABLE_SYSTEMD=1" ];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace 90-brightnessctl.rules --replace /bin/ ${coreutils}/bin/
|
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; {
|
meta = with stdenv.lib; {
|
||||||
homepage = "https://github.com/Hummer12007/brightnessctl";
|
homepage = "https://github.com/Hummer12007/brightnessctl";
|
||||||
description = "This program allows you read and control device brightness";
|
description = "This program allows you read and control device brightness";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user