1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

kwm: add option to manage config in /etc/kwmrc

Fixes #24
This commit is contained in:
Daiderd Jordan 2017-05-20 13:13:21 +02:00
parent 9f0b3c22c3
commit 2fda5848bb
No known key found for this signature in database
GPG key ID: D02435D05B810C96
2 changed files with 13 additions and 5 deletions

View file

@ -38,7 +38,7 @@ let
./modules/security
./modules/services/activate-system.nix
./modules/services/khd
./modules/services/kwm.nix
./modules/services/kwm
./modules/services/emacs.nix
./modules/services/mopidy.nix
./modules/services/nix-daemon.nix

View file

@ -18,7 +18,8 @@ in
services.kwm.package = mkOption {
type = types.path;
example = literalExample pkgs.kwm;
default = pkgs.kwm;
defaultText = "pkgs.kwm";
description = "This option specifies the kwm package to use";
};
@ -27,16 +28,23 @@ in
default = false;
description = "Whether to enable accessibility permissions for the kwm daemon.";
};
services.kwm.kwmConfig = mkOption {
type = types.lines;
default = "";
example = ''kwmc rule owner="iTerm2" properties={role="AXDialog"}'';
};
};
config = mkIf cfg.enable {
services.kwm.package = mkDefault pkgs.kwm;
security.accessibilityPrograms = mkIf cfg.enableAccessibilityAccess [ "${cfg.package}/kwm" ];
environment.etc."kwmrc".text = cfg.kwmConfig;
launchd.user.agents.kwm = {
serviceConfig.Program = "${cfg.package}/kwm";
serviceConfig.ProgramArguments = [ "${cfg.package}/kwm" ]
++ optionals (cfg.kwmConfig != "") [ "-c" "/etc/kwmrc" ];
serviceConfig.KeepAlive = true;
serviceConfig.ProcessType = "Interactive";
serviceConfig.Sockets.Listeners =