summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-01-25 22:50:12 +0100
committerDaiderd Jordan <daiderd@gmail.com>2017-01-25 22:50:12 +0100
commit0eb8384f0a8ed662c60934b7fa44f39d1b97fa7a (patch)
tree35fa3b3dce265dbf07226817ce4afeaa4a7668c6 /modules
parenta70795944fc7201ba91e68f0e62857454991c542 (diff)
fix khd service
Diffstat (limited to 'modules')
-rw-r--r--modules/launchd/default.nix2
-rw-r--r--modules/services/khd.nix44
2 files changed, 45 insertions, 1 deletions
diff --git a/modules/launchd/default.nix b/modules/launchd/default.nix
index d7c5054..16e761c 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 <envar>PATH</envar>
environment variable. Both the <filename>bin</filename>
diff --git a/modules/services/khd.nix b/modules/services/khd.nix
new file mode 100644
index 0000000..85cef82
--- /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";
+ };
+ };
+
+ };
+}