1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-03 15:41:02 +01:00

aerospace: auto-reload config on file changes;

This commit is contained in:
damidoug 2025-11-14 20:55:28 +01:00 committed by Austin Horstman
parent 29b672194d
commit 5b8d259ee6

View file

@ -180,9 +180,8 @@ in
home = {
packages = lib.mkIf (cfg.package != null) [ cfg.package ];
file.".config/aerospace/aerospace.toml".source =
let
generatedConfig = tomlFormat.generate "aerospace" (
file.".config/aerospace/aerospace.toml" = {
source = tomlFormat.generate "aerospace" (
filterNulls (
cfg.settings
// {
@ -192,16 +191,13 @@ in
}
)
);
extraConfig = pkgs.writeText "aerospace-extra-config" cfg.extraConfig;
in
pkgs.runCommandLocal "aerospace.toml"
{
inherit generatedConfig extraConfig;
}
''
cat "$generatedConfig" "$extraConfig" > "$out"
onChange = lib.mkIf cfg.launchd.enable ''
echo "AeroSpace config changed, reloading..."
${lib.getExe cfg.package} reload-config
'';
};
};
launchd.agents.aerospace = {
enable = cfg.launchd.enable;