mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-15 17:51:01 +00:00
4899b6658f
Iff the kwm service is enabled the commands will still be in the default PATH.
53 lines
1.3 KiB
Nix
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";
|
|
};
|
|
};
|
|
|
|
};
|
|
}
|