mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 09:29:41 +08:00
ghostty: prevent service restarts
Stopping or restarting the service will destroy open Ghostty sessions, potentially disrupting work. This change ensures that we leave the existing service untouched. Fixes #8485
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
ghostty-example-settings = ./example-settings.nix;
|
||||
ghostty-empty-settings = ./empty-settings.nix;
|
||||
ghostty-example-settings = ./example-settings.nix;
|
||||
ghostty-example-theme = ./example-theme.nix;
|
||||
}
|
||||
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
ghostty-systemd-service = ./systemd-service.nix;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
servicePath=home-files/.config/systemd/user/app-com.mitchellh.ghostty.service
|
||||
assertPathNotExists $servicePath
|
||||
|
||||
assertFileContent \
|
||||
home-files/.config/ghostty/config \
|
||||
${./example-config-expected}
|
||||
|
||||
28
tests/modules/programs/ghostty/systemd-service.nix
Normal file
28
tests/modules/programs/ghostty/systemd-service.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
programs.ghostty = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { outPath = null; };
|
||||
systemd.enable = true;
|
||||
settings = {
|
||||
theme = "catppuccin-mocha";
|
||||
font-size = 10;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
servicePath=home-files/.config/systemd/user/app-com.mitchellh.ghostty.service
|
||||
serviceOverridesPath=$servicePath.d/overrides.conf
|
||||
|
||||
assertFileExists $serviceOverridesPath
|
||||
assertFileContent $serviceOverridesPath \
|
||||
${builtins.toFile "ghostty-service-overrides" ''
|
||||
[Unit]
|
||||
X-SwitchMethod=keep-old
|
||||
''}
|
||||
|
||||
assertFileContent \
|
||||
home-files/.config/ghostty/config \
|
||||
${./example-config-expected}
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user