Add kbdlight package and setuid wrapper

update nixos/modules/programs/kbdlight.nix to use mkEnableOption
This commit is contained in:
Kranium Gikos Mendoza 2015-05-11 01:57:15 +08:00
parent e3696ed37f
commit 6f634e3c3a
5 changed files with 46 additions and 0 deletions

View file

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

View file

@ -62,6 +62,7 @@
./programs/environment.nix
./programs/info.nix
./programs/ibus.nix
./programs/kbdlight.nix
./programs/light.nix
./programs/nano.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

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