diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 4672dc59d431..c956d0a4a374 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -111,6 +111,7 @@ cwoac = "Oliver Matthews "; DamienCassou = "Damien Cassou "; danbst = "Danylo Hlynskyi "; + dancek = "Hannu Hartikainen "; danielfullmer = "Daniel Fullmer "; dasuxullebt = "Christoph-Simon Senjak "; davidak = "David Kleuker "; diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 1398542a5c17..bd427bc679c7 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -197,6 +197,7 @@ ./services/hardware/bluetooth.nix ./services/hardware/brltty.nix ./services/hardware/freefall.nix + ./services/hardware/illum.nix ./services/hardware/irqbalance.nix ./services/hardware/nvidia-optimus.nix ./services/hardware/pcscd.nix diff --git a/nixos/modules/services/hardware/illum.nix b/nixos/modules/services/hardware/illum.nix new file mode 100644 index 000000000000..ff73c99a6537 --- /dev/null +++ b/nixos/modules/services/hardware/illum.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.illum; +in { + + options = { + + services.illum = { + + enable = mkOption { + default = false; + type = types.bool; + description = '' + Enable illum, a daemon for controlling screen brightness with brightness buttons. + ''; + }; + + }; + + }; + + config = mkIf cfg.enable { + + systemd.services.illum = { + description = "Backlight Adjustment Service"; + wantedBy = [ "multi-user.target" ]; + serviceConfig.ExecStart = "${pkgs.illum}/bin/illum-d"; + }; + + }; + +} diff --git a/pkgs/tools/system/illum/default.nix b/pkgs/tools/system/illum/default.nix new file mode 100644 index 000000000000..4cdfeec12b79 --- /dev/null +++ b/pkgs/tools/system/illum/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchgit, pkgconfig, ninja, libevdev, libev }: + +stdenv.mkDerivation rec { + version = "0.4"; + name = "illum-${version}"; + + src = fetchgit { + url = "https://github.com/jmesmon/illum.git"; + fetchSubmodules = true; + rev = "48ce8631346b1c88a901a8e4fa5fa7e8ffe8e418"; + sha256 = "05v3hz7n6b1mlhc6zqijblh1vpl0ja1y8y0lafw7mjdz03wxhfdb"; + }; + + buildInputs = [ pkgconfig ninja libevdev libev ]; + + configurePhase = '' + bash ./configure + ''; + + buildPhase = '' + ninja + ''; + + installPhase = '' + mkdir -p $out/bin + mv illum-d $out/bin + ''; + + meta = { + homepage = https://github.com/jmesmon/illum; + description = "Daemon that wires button presses to screen backlight level"; + platforms = stdenv.lib.platforms.linux; + maintainers = [ stdenv.lib.maintainers.dancek ]; + license = stdenv.lib.licenses.agpl3; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7f4c71a00480..d7b8c4e8ee09 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17545,6 +17545,8 @@ with pkgs; hplipWithPlugin_3_15_9 = hplip_3_15_9.override { withPlugin = true; }; + illum = callPackage ../tools/system/illum { }; + # using the new configuration style proposal which is unstable jack1 = callPackage ../misc/jackaudio/jack1.nix { };