summary refs log tree commit diff
path: root/nixos/modules/services/hardware
diff options
context:
space:
mode:
authorRyan Mulligan <ryan@ryantm.com>2019-04-10 20:56:19 -0700
committerGitHub <noreply@github.com>2019-04-10 20:56:19 -0700
commit0960fc72b7cd6b212a034e2ae66ad32a3ffc4d33 (patch)
treee57b49d77d37746a15a5a4a8f9b5aa39e8f704a6 /nixos/modules/services/hardware
parent4bdd577aff74a50e01c9e20c34defd5d41fda7d2 (diff)
parentfab6a4376feab71e2a5630df98e6a5b42ac1ffc4 (diff)
downloadnixpkgs-0960fc72b7cd6b212a034e2ae66ad32a3ffc4d33.tar
nixpkgs-0960fc72b7cd6b212a034e2ae66ad32a3ffc4d33.tar.gz
nixpkgs-0960fc72b7cd6b212a034e2ae66ad32a3ffc4d33.tar.bz2
nixpkgs-0960fc72b7cd6b212a034e2ae66ad32a3ffc4d33.tar.lz
nixpkgs-0960fc72b7cd6b212a034e2ae66ad32a3ffc4d33.tar.xz
nixpkgs-0960fc72b7cd6b212a034e2ae66ad32a3ffc4d33.tar.zst
nixpkgs-0960fc72b7cd6b212a034e2ae66ad32a3ffc4d33.zip
Merge pull request #49868 from jfrankenau/fix-triggerhappy
nixos/triggerhappy: add option user
Diffstat (limited to 'nixos/modules/services/hardware')
-rw-r--r--nixos/modules/services/hardware/triggerhappy.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/services/hardware/triggerhappy.nix b/nixos/modules/services/hardware/triggerhappy.nix
index 81d4a1ae65b..bffe7353b10 100644
--- a/nixos/modules/services/hardware/triggerhappy.nix
+++ b/nixos/modules/services/hardware/triggerhappy.nix
@@ -57,6 +57,15 @@ in
         '';
       };
 
+      user = mkOption {
+        type = types.str;
+        default = "nobody";
+        example = "root";
+        description = ''
+          User account under which <command>triggerhappy</command> runs.
+        '';
+      };
+
       bindings = mkOption {
         type = types.listOf (types.submodule bindingCfg);
         default = [];
@@ -96,7 +105,7 @@ in
       after = [ "local-fs.target" ];
       description = "Global hotkey daemon";
       serviceConfig = {
-        ExecStart = "${pkgs.triggerhappy}/bin/thd --user nobody --socket ${socket} --triggers ${configFile} --deviceglob /dev/input/event*";
+        ExecStart = "${pkgs.triggerhappy}/bin/thd ${optionalString (cfg.user != "root") "--user ${cfg.user}"} --socket ${socket} --triggers ${configFile} --deviceglob /dev/input/event*";
       };
     };