1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

aerospace: add extraConfig

This commit is contained in:
Leon Erd 2025-10-17 23:18:22 +02:00 committed by Austin Horstman
parent 5c54b182ab
commit 64020f453b

View file

@ -81,6 +81,23 @@ in
};
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration to append to the aerospace.toml file.
This allows you to add raw TOML content, including multiline strings.
'';
example = lib.literalExpression ''
alt-enter = ''''exec-and-forget osascript -e '
tell application "Terminal"
do script
activate
end tell'
''''
'';
};
userSettings = mkOption {
type = types.submodule {
freeformType = tomlFormat.type;
@ -303,16 +320,20 @@ in
home = {
packages = lib.mkIf (cfg.package != null) [ cfg.package ];
file.".config/aerospace/aerospace.toml".source = tomlFormat.generate "aerospace" (
filterNulls (
cfg.userSettings
// lib.optionalAttrs cfg.launchd.enable {
# Override these to avoid launchd conflicts
start-at-login = false;
after-login-command = [ ];
}
)
);
file.".config/aerospace/aerospace.toml".text =
let
generatedConfig = tomlFormat.generate "aerospace" (
filterNulls (
cfg.userSettings
// lib.optionalAttrs cfg.launchd.enable {
# Override these to avoid launchd conflicts
start-at-login = false;
after-login-command = [ ];
}
)
);
in
builtins.readFile generatedConfig + lib.optionalString (cfg.extraConfig != "") "${cfg.extraConfig}";
};
launchd.agents.aerospace = {