31 lines
645 B
Nix
31 lines
645 B
Nix
{
|
|
pkgs,
|
|
system,
|
|
inputs,
|
|
osConfig,
|
|
lib,
|
|
config,
|
|
...
|
|
}: let
|
|
emacs = inputs.emacs-kylekrein.packages.${system}.with-lsps-native;
|
|
in {
|
|
programs.emacs = {
|
|
enable = osConfig.custom.presets.wayland.enable;
|
|
package = emacs;
|
|
};
|
|
systemd.user.services.emacs = lib.mkIf config.programs.emacs.enable {
|
|
Unit = {
|
|
Description = "Launches (and relaunches) emacs";
|
|
};
|
|
Install = {
|
|
WantedBy = ["default.target"];
|
|
};
|
|
Service = {
|
|
ExecStart = "${pkgs.writeShellScript "run-emacs" ''
|
|
${emacs}/bin/emacs --fg-daemon
|
|
''}";
|
|
Restart = "on-failure";
|
|
RestartSec = 5;
|
|
};
|
|
};
|
|
}
|