1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-03 07:31:03 +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,27 +180,23 @@ in
home = { home = {
packages = lib.mkIf (cfg.package != null) [ cfg.package ]; packages = lib.mkIf (cfg.package != null) [ cfg.package ];
file.".config/aerospace/aerospace.toml".source = file.".config/aerospace/aerospace.toml" = {
let source = tomlFormat.generate "aerospace" (
generatedConfig = tomlFormat.generate "aerospace" ( filterNulls (
filterNulls ( cfg.settings
cfg.settings // {
// { # Override these to avoid launchd conflicts
# Override these to avoid launchd conflicts start-at-login = false;
start-at-login = false; after-login-command = [ ];
after-login-command = [ ]; }
} )
) );
);
extraConfig = pkgs.writeText "aerospace-extra-config" cfg.extraConfig; onChange = lib.mkIf cfg.launchd.enable ''
in echo "AeroSpace config changed, reloading..."
pkgs.runCommandLocal "aerospace.toml" ${lib.getExe cfg.package} reload-config
{ '';
inherit generatedConfig extraConfig; };
}
''
cat "$generatedConfig" "$extraConfig" > "$out"
'';
}; };
launchd.agents.aerospace = { launchd.agents.aerospace = {