mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-28 02:37:09 +00:00
khd: add option to manage config in /etc/khdrc
This commit is contained in:
parent
f52109ae5a
commit
c8c2763c9e
2 changed files with 12 additions and 5 deletions
|
@ -37,7 +37,7 @@ let
|
|||
./modules/launchd
|
||||
./modules/security
|
||||
./modules/services/activate-system.nix
|
||||
./modules/services/khd.nix
|
||||
./modules/services/khd
|
||||
./modules/services/kwm.nix
|
||||
./modules/services/emacs.nix
|
||||
./modules/services/mopidy.nix
|
||||
|
|
|
@ -18,7 +18,8 @@ in
|
|||
|
||||
services.khd.package = mkOption {
|
||||
type = types.package;
|
||||
example = literalExample "pkgs.khd";
|
||||
default = pkgs.khd;
|
||||
defaultText = "pkgs.khd";
|
||||
description = "This option specifies the khd package to use.";
|
||||
};
|
||||
|
||||
|
@ -27,18 +28,24 @@ in
|
|||
default = false;
|
||||
description = "Whether to enable accessibility permissions for the khd daemon.";
|
||||
};
|
||||
|
||||
services.khd.khdConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = "alt + shift - r : kwmc quit";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.khd.package = mkDefault pkgs.khd;
|
||||
|
||||
security.accessibilityPrograms = mkIf cfg.enableAccessibilityAccess [ "${cfg.package}/bin/khd" ];
|
||||
|
||||
environment.etc."khdrc".text = cfg.khdConfig;
|
||||
|
||||
launchd.user.agents.khd = {
|
||||
path = [ cfg.package pkgs.kwm config.environment.systemPath ];
|
||||
|
||||
serviceConfig.Program = "${cfg.package}/bin/khd";
|
||||
serviceConfig.ProgramArguments = [ "${cfg.package}/bin/khd" "-c" "/etc/khdrc" ];
|
||||
serviceConfig.KeepAlive = true;
|
||||
serviceConfig.ProcessType = "Interactive";
|
||||
serviceConfig.Sockets.Listeners =
|
Loading…
Add table
Reference in a new issue