Emacs custom service

This commit is contained in:
Aleksandr Lebedev 2025-08-01 20:55:58 +02:00
parent 81757ca17e
commit 889ecc9a44
3 changed files with 17 additions and 7 deletions

View file

@ -1,5 +1,6 @@
{ {
config, config,
pkgs,
hwconfig, hwconfig,
inputs, inputs,
... ...
@ -10,4 +11,19 @@ in {
enable = true; enable = true;
package = emacs; package = emacs;
}; };
systemd.user.services.emacs = {
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;
};
};
} }

View file

@ -115,12 +115,6 @@ in {
"${../../modules/hyprland/wallpaper.jpg}" "${../../modules/hyprland/wallpaper.jpg}"
]; ];
} }
{
command = [
"${config.programs.emacs.package}/bin/emacs"
"--daemon"
];
}
]; ];
layout = { layout = {
preset-column-widths = [ preset-column-widths = [

View file

@ -18,7 +18,7 @@ in {
#initialPassword = "1234"; #initialPassword = "1234";
hashedPasswordFile = config.sops.secrets."users/${username}".path; hashedPasswordFile = config.sops.secrets."users/${username}".path;
packages = with pkgs; []; packages = with pkgs; [];
linger = true; linger = false;
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMt3PWVvmEL6a0HHTsxL4KMq1UGKFdzgX5iIkm6owGQ kylekrein@kylekrein-mac" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMt3PWVvmEL6a0HHTsxL4KMq1UGKFdzgX5iIkm6owGQ kylekrein@kylekrein-mac"