diff options
| author | Piotr Limanowski <plimanowski@codearsonist.com> | 2017-02-19 11:20:26 +0100 |
|---|---|---|
| committer | Piotr Limanowski <plimanowski@codearsonist.com> | 2017-02-19 11:53:25 +0100 |
| commit | 79c902422a1b389fa8252d111efd296827d76afd (patch) | |
| tree | 05abf22183cf6f3387b8045d3973e4ba6c8be504 | |
| parent | a1011ad98b728ff65fef318edd4b79dbbd8c70c2 (diff) | |
adds emacs launchd service
| -rw-r--r-- | default.nix | 1 | ||||
| -rw-r--r-- | modules/services/emacs.nix | 41 |
2 files changed, 42 insertions, 0 deletions
diff --git a/default.nix b/default.nix index 9974314..28316f7 100644 --- a/default.nix +++ b/default.nix @@ -38,6 +38,7 @@ let ./modules/services/activate-system.nix ./modules/services/khd.nix ./modules/services/kwm.nix + ./modules/services/emacs.nix ./modules/services/nix-daemon.nix ./modules/programs/bash.nix ./modules/programs/fish.nix 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 |
