Merge pull request #7794 from womfoo/kbdlight

Add kbdlight package and setuid wrapper
This commit is contained in:
lethalman 2015-05-14 17:09:28 +02:00
commit 1103392dd9
5 changed files with 46 additions and 0 deletions

View file

@ -222,6 +222,7 @@
winden = "Antonio Vargas Gonzalez <windenntw@gmail.com>"; winden = "Antonio Vargas Gonzalez <windenntw@gmail.com>";
wizeman = "Ricardo M. Correia <rcorreia@wizy.org>"; wizeman = "Ricardo M. Correia <rcorreia@wizy.org>";
wjlroe = "William Roe <willroe@gmail.com>"; wjlroe = "William Roe <willroe@gmail.com>";
womfoo = "Kranium Gikos Mendoza <kranium@gikos.net>";
wkennington = "William A. Kennington III <william@wkennington.com>"; wkennington = "William A. Kennington III <william@wkennington.com>";
wmertens = "Wout Mertens <Wout.Mertens@gmail.com>"; wmertens = "Wout Mertens <Wout.Mertens@gmail.com>";
wscott = "Wayne Scott <wsc9tt@gmail.com>"; wscott = "Wayne Scott <wsc9tt@gmail.com>";

View file

@ -62,6 +62,7 @@
./programs/environment.nix ./programs/environment.nix
./programs/info.nix ./programs/info.nix
./programs/ibus.nix ./programs/ibus.nix
./programs/kbdlight.nix
./programs/light.nix ./programs/light.nix
./programs/nano.nix ./programs/nano.nix
./programs/screen.nix ./programs/screen.nix

View file

@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.kbdlight;
in
{
options.programs.kbdlight.enable = mkEnableOption "kbdlight";
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.kbdlight ];
security.setuidPrograms = [ "kbdlight" ];
};
}

View file

@ -0,0 +1,26 @@
{ stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
name = "kbdlight-${version}";
version = "1.3";
src = fetchFromGitHub {
owner = "hobarrera";
repo = "kbdlight";
rev = "v${version}";
sha256 = "1f08aid1xrbl4sb5447gkip9lnvkia1c4ap0v8zih5s9w8v72bny";
};
preConfigure = ''
substituteInPlace Makefile \
--replace /usr/local $out
'';
meta = with stdenv.lib; {
homepage = https://github.com/hobarrera/kbdlight;
description = "A very simple application that changes MacBooks' keyboard backlight level";
license = licenses.isc;
maintainers = [ maintainers.womfoo ];
platforms = platforms.linux;
};
}

View file

@ -9230,6 +9230,8 @@ let
kbd = callPackage ../os-specific/linux/kbd { }; kbd = callPackage ../os-specific/linux/kbd { };
kbdlight = callPackage ../os-specific/linux/kbdlight { };
kmscon = callPackage ../os-specific/linux/kmscon { }; kmscon = callPackage ../os-specific/linux/kmscon { };
latencytop = callPackage ../os-specific/linux/latencytop { }; latencytop = callPackage ../os-specific/linux/latencytop { };