mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-15 17:51:01 +00:00
adds skhd module
This commit is contained in:
parent
055287cf98
commit
577961c162
2 changed files with 50 additions and 0 deletions
|
@ -56,6 +56,7 @@ let
|
||||||
./modules/services/ofborg
|
./modules/services/ofborg
|
||||||
./modules/services/postgresql
|
./modules/services/postgresql
|
||||||
./modules/services/redis
|
./modules/services/redis
|
||||||
|
./modules/services/skhd
|
||||||
./modules/programs/bash
|
./modules/programs/bash
|
||||||
./modules/programs/fish.nix
|
./modules/programs/fish.nix
|
||||||
./modules/programs/man.nix
|
./modules/programs/man.nix
|
||||||
|
|
49
modules/services/skhd/default.nix
Normal file
49
modules/services/skhd/default.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.skhd;
|
||||||
|
|
||||||
|
in {
|
||||||
|
|
||||||
|
options = {
|
||||||
|
services.skhd.enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Whether to enable the skhd hotkey daemon.";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.skhd.package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
example = literalExample "pkgs.skhd";
|
||||||
|
description = "This option specifies the skhd package to use.";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.skhd.skhdConfig = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
example = "alt + shift - r : chunkc quit";
|
||||||
|
description = "Config to use for <filename>skhdrc</filename>.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
security.accessibilityPrograms = [ "${cfg.package}/bin/skhd" ];
|
||||||
|
|
||||||
|
environment.etc."skhdrc".text = cfg.skhdConfig;
|
||||||
|
|
||||||
|
launchd.user.agents.skhd = {
|
||||||
|
path = [ cfg.package config.environment.systemPath ];
|
||||||
|
|
||||||
|
serviceConfig.ProgramArguments = [ "${cfg.package}/bin/skhd" ]
|
||||||
|
++ optionals (cfg.skhdConfig != "") [ "-c" "/etc/skhdrc" ];
|
||||||
|
serviceConfig.KeepAlive = true;
|
||||||
|
serviceConfig.ProcessType = "Interactive";
|
||||||
|
serviceConfig.StandardOutPath = "/tmp/skhd.out";
|
||||||
|
serviceConfig.StandardErrorPath = "/tmp/skhd.err";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue