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/emacs.nix

46 lines
823 B
Nix
Raw Normal View History

2017-02-19 11:20:26 +01:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.emacs;
in
{
options = {
services.emacs = {
enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable the Emacs Daemon.";
};
package = mkOption {
type = types.path;
default = pkgs.emacs;
description = "This option specifies the emacs package to use.";
};
exec = mkOption {
type = types.string;
default = "emacs";
2017-07-06 21:54:38 +02:00
description = "Emacs command/binary to execute.";
};
2017-02-19 11:20:26 +01:00
};
};
config = mkIf cfg.enable {
launchd.user.agents.emacs = {
serviceConfig.ProgramArguments = [
"${cfg.package}/bin/${cfg.exec}"
2017-02-19 11:20:26 +01:00
"--daemon"
];
serviceConfig.RunAtLoad = true;
};
};
}