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:
parent
29b672194d
commit
5b8d259ee6
1 changed files with 17 additions and 21 deletions
|
|
@ -180,9 +180,8 @@ 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
|
||||||
// {
|
// {
|
||||||
|
|
@ -192,16 +191,13 @@ in
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
extraConfig = pkgs.writeText "aerospace-extra-config" cfg.extraConfig;
|
|
||||||
in
|
onChange = lib.mkIf cfg.launchd.enable ''
|
||||||
pkgs.runCommandLocal "aerospace.toml"
|
echo "AeroSpace config changed, reloading..."
|
||||||
{
|
${lib.getExe cfg.package} reload-config
|
||||||
inherit generatedConfig extraConfig;
|
|
||||||
}
|
|
||||||
''
|
|
||||||
cat "$generatedConfig" "$extraConfig" > "$out"
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
launchd.agents.aerospace = {
|
launchd.agents.aerospace = {
|
||||||
enable = cfg.launchd.enable;
|
enable = cfg.launchd.enable;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue