mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-16 05:18:17 +00:00
fix khd service
This commit is contained in:
parent
a70795944f
commit
0eb8384f0a
2 changed files with 45 additions and 1 deletions
|
@ -35,7 +35,7 @@ let
|
||||||
path = mkOption {
|
path = mkOption {
|
||||||
type = types.listOf types.path;
|
type = types.listOf types.path;
|
||||||
default = [];
|
default = [];
|
||||||
apply = ps: makeBinPath ps;
|
apply = ps: "${makeBinPath ps}";
|
||||||
description = ''
|
description = ''
|
||||||
Packages added to the service's <envar>PATH</envar>
|
Packages added to the service's <envar>PATH</envar>
|
||||||
environment variable. Both the <filename>bin</filename>
|
environment variable. Both the <filename>bin</filename>
|
||||||
|
|
44
modules/services/khd.nix
Normal file
44
modules/services/khd.nix
Normal file
|
@ -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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue