diff --git a/modules/launchd/default.nix b/modules/launchd/default.nix
index d7c50549..16e761c2 100644
--- a/modules/launchd/default.nix
+++ b/modules/launchd/default.nix
@@ -35,7 +35,7 @@ let
path = mkOption {
type = types.listOf types.path;
default = [];
- apply = ps: makeBinPath ps;
+ apply = ps: "${makeBinPath ps}";
description = ''
Packages added to the service's PATH
environment variable. Both the bin
diff --git a/modules/services/khd.nix b/modules/services/khd.nix
new file mode 100644
index 00000000..85cef828
--- /dev/null
+++ b/modules/services/khd.nix
@@ -0,0 +1,44 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.services.khd;
+
+in
+
+{
+ options = {
+ services.khd = {
+
+ enable = mkOption {
+ type = types.bool;
+ default = false;
+ description = "Whether to enable the khd hototkey daemon.";
+ };
+
+ package = mkOption {
+ type = types.path;
+ default = pkgs.khd;
+ description = "This option specifies the khd package to use";
+ };
+
+ };
+ };
+
+ config = mkIf cfg.enable {
+
+ launchd.user.agents.khd = {
+ serviceConfig.Program = "${cfg.package}/bin/khd";
+ serviceConfig.KeepAlive = true;
+ serviceConfig.ProcessType = "Interactive";
+ serviceConfig.Sockets.Listeners =
+ { SockServiceName = "3021";
+ SockType = "dgram";
+ SockFamily = "IPv4";
+ };
+ };
+
+ };
+}