mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 09:29:41 +08:00
ghostty: use the systemd X-Base option
This commit is contained in:
@@ -225,22 +225,18 @@ in
|
||||
}
|
||||
];
|
||||
|
||||
xdg.configFile."systemd/user/app-com.mitchellh.ghostty.service".source =
|
||||
"${cfg.package}/share/systemd/user/app-com.mitchellh.ghostty.service";
|
||||
|
||||
xdg.configFile."systemd/user/app-com.mitchellh.ghostty.service.d/overrides.conf".text = ''
|
||||
[Unit]
|
||||
X-SwitchMethod=keep-old
|
||||
X-Reload-Triggers=${
|
||||
let
|
||||
storePathOf = name: config.xdg.configFile.${name}.source;
|
||||
in
|
||||
toString (
|
||||
systemd.user.services."app-com.mitchellh.ghostty" = {
|
||||
Unit = {
|
||||
X-Base = "${cfg.package}/share/systemd/user/app-com.mitchellh.ghostty.service";
|
||||
X-SwitchMethod = "keep-old";
|
||||
X-Reload-Triggers =
|
||||
let
|
||||
storePathOf = name: config.xdg.configFile.${name}.source;
|
||||
in
|
||||
lib.optionals (cfg.settings != { }) [ (storePathOf "ghostty/config") ]
|
||||
++ lib.mapAttrsToList (name: _: storePathOf "ghostty/themes/${name}") cfg.themes
|
||||
)
|
||||
}
|
||||
'';
|
||||
++ lib.mapAttrsToList (name: _: storePathOf "ghostty/themes/${name}") cfg.themes;
|
||||
};
|
||||
};
|
||||
|
||||
dbus.packages = [ cfg.package ];
|
||||
})
|
||||
|
||||
@@ -45,8 +45,9 @@
|
||||
assertFileContent $(normalizeStorePaths $serviceOverridesPath) \
|
||||
${builtins.toFile "ghostty-service-overrides" ''
|
||||
[Unit]
|
||||
X-Reload-Triggers=/nix/store/00000000000000000000000000000000-ghostty-config
|
||||
X-Reload-Triggers=/nix/store/00000000000000000000000000000000-ghostty-catppuccin-mocha-theme
|
||||
X-SwitchMethod=keep-old
|
||||
X-Reload-Triggers=/nix/store/00000000000000000000000000000000-ghostty-config /nix/store/00000000000000000000000000000000-ghostty-catppuccin-mocha-theme
|
||||
''}
|
||||
|
||||
assertFileContent \
|
||||
|
||||
Reference in New Issue
Block a user