mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
emacs: respect defaultEditor on Darwin (#7063)
Currently on Darwin, services.emacs.defaultEditor = true isn't respected, as the variable is only configured on Linux. This PR simply moves the variable out to a common block, so it's applied on all platforms.
This commit is contained in:
parent
6bf057fc83
commit
02ea79853c
1 changed files with 9 additions and 9 deletions
|
|
@ -120,6 +120,14 @@ in
|
|||
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
home.sessionVariables = mkIf cfg.defaultEditor {
|
||||
EDITOR = lib.getBin (
|
||||
pkgs.writeShellScript "editor" ''exec ${lib.getBin cfg.package}/bin/emacsclient "''${@:---create-frame}"''
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf pkgs.stdenv.isLinux {
|
||||
systemd.user.services.emacs =
|
||||
{
|
||||
|
|
@ -179,15 +187,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
home = {
|
||||
packages = optional cfg.client.enable (lib.hiPrio clientDesktopItem);
|
||||
|
||||
sessionVariables = mkIf cfg.defaultEditor {
|
||||
EDITOR = lib.getBin (
|
||||
pkgs.writeShellScript "editor" ''exec ${lib.getBin cfg.package}/bin/emacsclient "''${@:---create-frame}"''
|
||||
);
|
||||
};
|
||||
};
|
||||
home.packages = optional cfg.client.enable (lib.hiPrio clientDesktopItem);
|
||||
})
|
||||
|
||||
(mkIf (cfg.socketActivation.enable && pkgs.stdenv.isLinux) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue