1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-06 08:47:00 +00:00
nix-darwin/modules/services/skhd/default.nix
Alyssa Ross af84b3c519
Make the skhd service default to the skhd package
This can be overrided if necessary, but I don't see any reason the
nixpkgs package shouldn't be the default. It looks like this package
didn't exist when the service was created.
2018-07-27 16:12:49 +01:00

45 lines
1 KiB
Nix

{ 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;
default = 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 {
environment.etc."skhdrc".text = cfg.skhdConfig;
launchd.user.agents.skhd = {
path = [ config.environment.systemPath ];
serviceConfig.ProgramArguments = [ "${cfg.package}/bin/skhd" ]
++ optionals (cfg.skhdConfig != "") [ "-c" "/etc/skhdrc" ];
serviceConfig.KeepAlive = true;
serviceConfig.ProcessType = "Interactive";
};
};
}