1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-06 16:57:08 +00:00
nix-darwin/modules/services/kwm/default.nix

54 lines
1.3 KiB
Nix
Raw Normal View History

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