diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 246a6d06cec..059969b92d3 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 00000000000..341e4b791c2 --- /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 e45909eb2d6..cd594b934b8 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 00000000000..ef53dc1446b --- /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 7a91080212f..4ffc88444ad 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 { };