diff --git a/nixos/homes/kylekrein/emacs.nix b/nixos/homes/kylekrein/emacs.nix index f8bbfab..6c43a49 100644 --- a/nixos/homes/kylekrein/emacs.nix +++ b/nixos/homes/kylekrein/emacs.nix @@ -1,5 +1,6 @@ { config, + pkgs, hwconfig, inputs, ... @@ -10,4 +11,19 @@ in { enable = true; 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; + }; + }; } diff --git a/nixos/homes/kylekrein/niri.nix b/nixos/homes/kylekrein/niri.nix index 666a15f..f40d856 100644 --- a/nixos/homes/kylekrein/niri.nix +++ b/nixos/homes/kylekrein/niri.nix @@ -115,12 +115,6 @@ in { "${../../modules/hyprland/wallpaper.jpg}" ]; } - { - command = [ - "${config.programs.emacs.package}/bin/emacs" - "--daemon" - ]; - } ]; layout = { preset-column-widths = [ diff --git a/nixos/users/kylekrein/default.nix b/nixos/users/kylekrein/default.nix index e880a01..37222f9 100644 --- a/nixos/users/kylekrein/default.nix +++ b/nixos/users/kylekrein/default.nix @@ -18,7 +18,7 @@ in { #initialPassword = "1234"; hashedPasswordFile = config.sops.secrets."users/${username}".path; packages = with pkgs; []; - linger = true; + linger = false; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMt3PWVvmEL6a0HHTsxL4KMq1UGKFdzgX5iIkm6owGQ kylekrein@kylekrein-mac"