diff options
| author | qaristote <quentin.aristote@ens.fr> | 2023-03-14 17:44:59 +0100 |
|---|---|---|
| committer | qaristote <quentin.aristote@ens.fr> | 2023-03-14 17:44:59 +0100 |
| commit | 53d59b49ee888bada1b24bbe15865012f9ce9809 (patch) | |
| tree | baec51c3871a9fd9964ebcdc0407c2dd65d9cd03 /modules/home-manager | |
| parent | 4f20f2983a97a427fd1bd7ca649cde37a3e935e2 (diff) | |
home: emacs: correctly wrap emacs with dependencies
Diffstat (limited to 'modules/home-manager')
| -rw-r--r-- | modules/home-manager/personal/programs/emacs.nix | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/modules/home-manager/personal/programs/emacs.nix b/modules/home-manager/personal/programs/emacs.nix index ac87ef6..da0c07f 100644 --- a/modules/home-manager/personal/programs/emacs.nix +++ b/modules/home-manager/personal/programs/emacs.nix @@ -21,10 +21,23 @@ let }) { emacs = cfg.package; }; in { config = lib.mkIf cfg.enable { + services.emacs = { enable = lib.mkDefault true; client.enable = lib.mkDefault true; startWithUserSession = lib.mkDefault true; + package = let emacs = config.programs.emacs.finalPackage; in + pkgs.runCommand "emacsWrapped" { + nativeBuildInputs = with pkgs; [ makeWrapper ]; + } '' + mkdir "$out" + ln -s ${emacs}/share "$out" + for binary in ${emacs}/bin/* + do + makeWrapper "$binary" "$out"/bin/$(basename "$binary")\ + --prefix PATH : ${lib.makeBinPath (with pkgs; [ gnutar gcc ])} + done + ''; }; home.sessionVariables.EDITOR = "emacsclient --tty"; home.shellAliases.editor = "emacsclient --create-frame"; @@ -50,9 +63,6 @@ in { OnCalendar = "daily"; }; Install = { WantedBy = [ "default.target" ]; }; - }) // { - services.emacs.Service.Environment = with pkgs; - [ "PATH=${gnutar}/bin:${gcc}/bin:$PATH" ]; - }; + }); }; } |
