mirror of
https://github.com/nix-community/home-manager
synced 2024-12-21 02:23:16 +00:00
ac82c036d8
Emacs 27 added Type=notify support and updated the service definition to remove the use of `emacsclient' to kill the service. Emacs 28 changes the `StartupWMClass' in emacsclient.desktop to `Emacsd'. Update our emacs.service and emacsclient.desktop definitions to match upstream changes. When killing emacs.service, the socket is removed, and subsequently starting the service manually results in a service without a socket. Prevent this by adding `RefuseManualStart=true' to the service's Unit definition. Drop Emacs 26 support as it is no longer shipped in nixpkgs. Update the tests to verify the following configuration scenarios: - Emacs version: 27, 28 - Socket activation: disabled, enabled
42 lines
1.3 KiB
Nix
42 lines
1.3 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
in {
|
|
config = {
|
|
nixpkgs.overlays = [
|
|
(self: super: rec {
|
|
emacs = pkgs.writeShellScriptBin "dummy-emacs-28.0.5" "" // {
|
|
outPath = "@emacs@";
|
|
};
|
|
emacsPackagesFor = _:
|
|
makeScope super.newScope (_: { emacsWithPackages = _: emacs; });
|
|
})
|
|
];
|
|
|
|
programs.emacs.enable = true;
|
|
services.emacs.enable = true;
|
|
services.emacs.client.enable = true;
|
|
services.emacs.socketActivation.enable = true;
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.config/systemd/user/emacs.socket
|
|
assertFileExists home-files/.config/systemd/user/emacs.service
|
|
assertFileExists home-path/share/applications/emacsclient.desktop
|
|
|
|
assertFileContent home-files/.config/systemd/user/emacs.socket \
|
|
${./emacs-socket-emacs.socket}
|
|
assertFileContent home-files/.config/systemd/user/emacs.service \
|
|
${
|
|
pkgs.substituteAll {
|
|
inherit (pkgs) runtimeShell;
|
|
src = ./emacs-socket-emacs.service;
|
|
}
|
|
}
|
|
assertFileContent home-path/share/applications/emacsclient.desktop \
|
|
${./emacs-28-emacsclient.desktop}
|
|
'';
|
|
};
|
|
}
|