diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2017-02-19 12:01:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-19 12:01:23 +0100 |
| commit | b7c962a0d48c9ed79e2c69bd5a2b9c072ebd8724 (patch) | |
| tree | 05abf22183cf6f3387b8045d3973e4ba6c8be504 /modules | |
| parent | a1011ad98b728ff65fef318edd4b79dbbd8c70c2 (diff) | |
| parent | 79c902422a1b389fa8252d111efd296827d76afd (diff) | |
Merge pull request #13 from peel/master
adds emacs launchd service
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 |
