1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 02:37:09 +00:00

Merge pull request #252 from happysalada/fix_emacs_path

emacs: add system path env var
This commit is contained in:
Daiderd Jordan 2020-12-06 15:25:48 +01:00 committed by GitHub
commit db1631f150
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,9 +6,7 @@ let
cfg = config.services.emacs;
in
{
in {
options = {
services.emacs = {
enable = mkOption {
@ -23,6 +21,17 @@ in
description = "This option specifies the emacs package to use.";
};
additionalPath = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "/Users/my_user_name" ];
description = ''
This option specifies additional PATH that the emacs daemon would have.
Typically if you have binaries in your home directory that is what you would add your home path here.
One caveat is that there won't be shell variable expansion, so you can't use $HOME for example
'';
};
exec = mkOption {
type = types.str;
default = "emacs";
@ -34,10 +43,9 @@ in
config = mkIf cfg.enable {
launchd.user.agents.emacs = {
serviceConfig.ProgramArguments = [
"${cfg.package}/bin/${cfg.exec}"
"--fg-daemon"
];
path = cfg.additionalPath ++ [ config.environment.systemPath ];
serviceConfig.ProgramArguments =
[ "${cfg.package}/bin/${cfg.exec}" "--fg-daemon" ];
serviceConfig.RunAtLoad = true;
};