about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--maintainers/maintainer-list.nix5
-rw-r--r--nixos/modules/hardware/brightnessctl.nix30
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--pkgs/misc/brightnessctl/default.nix29
-rw-r--r--pkgs/top-level/all-packages.nix2
5 files changed, 67 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 246a6d06cec2..059969b92d36 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -78,6 +78,11 @@
     github = "DmitryTsygankov";
     name = "Dmitry Tsygankov";
   };
+  Dje4321 = {
+    email = "dje4321@gmail.com";
+    github = "dje4321";
+    name = "Dje4321";
+  };
   Esteth = {
     email = "adam.copp@gmail.com";
     name = "Adam Copp";
diff --git a/nixos/modules/hardware/brightnessctl.nix b/nixos/modules/hardware/brightnessctl.nix
new file mode 100644
index 000000000000..341e4b791c23
--- /dev/null
+++ b/nixos/modules/hardware/brightnessctl.nix
@@ -0,0 +1,30 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+  cfg = config.hardware.brightnessctl;
+in
+{
+
+  options = {
+
+    hardware.brightnessctl = {
+
+      enable = mkOption {
+        default = false;
+        type = types.bool;
+        description = ''
+          Enable brightnessctl in userspace.
+          This will allow brightness control from users in the video group.
+        '';
+
+      };
+    };
+  };
+
+
+  config = mkIf cfg.enable {
+    services.udev.packages = with pkgs; [ brightnessctl ];
+  };
+
+}
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index e45909eb2d6a..cd594b934b83 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -29,6 +29,7 @@
   ./config/vpnc.nix
   ./config/zram.nix
   ./hardware/all-firmware.nix
+  ./hardware/brightnessctl.nix
   ./hardware/ckb.nix
   ./hardware/cpu/amd-microcode.nix
   ./hardware/cpu/intel-microcode.nix
diff --git a/pkgs/misc/brightnessctl/default.nix b/pkgs/misc/brightnessctl/default.nix
new file mode 100644
index 000000000000..ef53dc1446b8
--- /dev/null
+++ b/pkgs/misc/brightnessctl/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub, coreutils }:
+
+stdenv.mkDerivation rec {
+  name = "brightnessctl-${version}";
+  version = "0.3.2";
+
+  src = fetchFromGitHub {
+    owner = "Hummer12007";
+    repo = "brightnessctl";
+    rev = "${version}";
+    sha256 = "0amxhcikcgj04z81272kz35m5h5q4jx9x7v71h8yl1rv4b2lzh7z";
+  };
+
+  makeFlags = "MODE=0 PREFIX=/ DESTDIR=$(out)";
+
+  patchPhase = ''
+    substituteInPlace 90-brightnessctl.rules --replace /bin/ ${coreutils}/bin/
+    substituteInPlace 90-brightnessctl.rules --replace %k '*'
+  '';
+
+  meta = {
+    homepage = "https://github.com/Hummer12007/brightnessctl";
+    maintainers = [ stdenv.lib.maintainers.Dje4321 ];
+    license = stdenv.lib.licenses.mit;
+    description = "This program allows you read and control device brightness";
+    platforms = stdenv.lib.platforms.linux;
+  };
+
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 7a91080212fc..4ffc88444ad6 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -20729,6 +20729,8 @@ with pkgs;
 
   brgenml1cupswrapper = callPackage ../misc/cups/drivers/brgenml1cupswrapper {};
 
+  brightnessctl = callPackage ../misc/brightnessctl { };
+
   calaos_installer = libsForQt5.callPackage ../misc/calaos/installer {};
 
   click = callPackage ../applications/networking/cluster/click { };