diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/services/emacs.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/modules/services/emacs.nix b/modules/services/emacs.nix new file mode 100644 index 0000000..21f4f8c --- /dev/null +++ b/modules/services/emacs.nix @@ -0,0 +1,41 @@ +{ 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."; + }; + + }; + }; + + config = mkIf cfg.enable { + + launchd.user.agents.emacs = { + serviceConfig.ProgramArguments = [ + "${cfg.package}/bin/emacs" + "--daemon" + ]; + serviceConfig.RunAtLoad = true; + }; + + }; +}
\ No newline at end of file |
