1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-15 17:51:01 +00:00
nix-darwin/modules/services/kwm/default.nix
Daiderd Jordan 4899b6658f
khd: don't depend on kwm directly
Iff the kwm service is enabled the commands will still be in the default PATH.
2018-03-27 21:42:50 +02:00

53 lines
1.3 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.kwm;
in
{
options = {
services.kwm.enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable the khd window manager.";
};
services.kwm.package = mkOption {
type = types.path;
default = pkgs.kwm;
defaultText = "pkgs.kwm";
description = "This option specifies the kwm package to use.";
};
services.kwm.kwmConfig = mkOption {
type = types.lines;
default = "";
example = ''kwmc rule owner="iTerm2" properties={role="AXDialog"}'';
description = "Config to use for <filename>kwmrc</filename>.";
};
};
config = mkIf cfg.enable {
security.accessibilityPrograms = [ "${cfg.package}/kwm" ];
environment.systemPackages = [ cfg.package ];
environment.etc."kwmrc".text = cfg.kwmConfig;
launchd.user.agents.kwm = {
serviceConfig.ProgramArguments = [ "${cfg.package}/kwm" ]
++ optionals (cfg.kwmConfig != "") [ "-c" "/etc/kwmrc" ];
serviceConfig.KeepAlive = true;
serviceConfig.ProcessType = "Interactive";
serviceConfig.Sockets.Listeners =
{ SockServiceName = "3020";
SockType = "dgram";
SockFamily = "IPv4";
};
};
};
}