mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
adds emacs launchd service
This commit is contained in:
parent
a1011ad98b
commit
79c902422a
2 changed files with 42 additions and 0 deletions
|
@ -38,6 +38,7 @@ let
|
||||||
./modules/services/activate-system.nix
|
./modules/services/activate-system.nix
|
||||||
./modules/services/khd.nix
|
./modules/services/khd.nix
|
||||||
./modules/services/kwm.nix
|
./modules/services/kwm.nix
|
||||||
|
./modules/services/emacs.nix
|
||||||
./modules/services/nix-daemon.nix
|
./modules/services/nix-daemon.nix
|
||||||
./modules/programs/bash.nix
|
./modules/programs/bash.nix
|
||||||
./modules/programs/fish.nix
|
./modules/programs/fish.nix
|
||||||
|
|
41
modules/services/emacs.nix
Normal file
41
modules/services/emacs.nix
Normal file
|
@ -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;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue