summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
authorBrian McKenna <brian@simpleenergy.com>2014-11-09 19:32:11 -0700
committerBrian McKenna <brian@simpleenergy.com>2014-11-09 19:45:43 -0700
commita6bacd4d817c822287995eb1d9f7450d484f97ff (patch)
tree1ead57461cf619633199be3ba095c8e49c7af96e /nixos/modules/programs
parente69dc2be2df88f07d75ff98607a67c108c414309 (diff)
downloadnixlib-a6bacd4d817c822287995eb1d9f7450d484f97ff.tar
nixlib-a6bacd4d817c822287995eb1d9f7450d484f97ff.tar.gz
nixlib-a6bacd4d817c822287995eb1d9f7450d484f97ff.tar.bz2
nixlib-a6bacd4d817c822287995eb1d9f7450d484f97ff.tar.lz
nixlib-a6bacd4d817c822287995eb1d9f7450d484f97ff.tar.xz
nixlib-a6bacd4d817c822287995eb1d9f7450d484f97ff.tar.zst
nixlib-a6bacd4d817c822287995eb1d9f7450d484f97ff.zip
Add "light" package and setuid wrapper
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r--nixos/modules/programs/light.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/nixos/modules/programs/light.nix b/nixos/modules/programs/light.nix
new file mode 100644
index 000000000000..09cd1113d9c7
--- /dev/null
+++ b/nixos/modules/programs/light.nix
@@ -0,0 +1,26 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.programs.light;
+
+in
+{
+  options = {
+    programs.light = {
+      enable = mkOption {
+        default = false;
+        type = types.bool;
+        description = ''
+          Whether to install Light backlight control with setuid wrapper.
+        '';
+      };
+    };
+  };
+
+  config = mkIf cfg.enable {
+    environment.systemPackages = [ pkgs.light ];
+    security.setuidPrograms = [ "light" ];
+  };
+}