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

aerospace: revert flattening on-window-detected rules (#6803)

This reverts commits 95861b5d9f and
d2c014e1c7 (PR #6778), as they broke
Aerospace configuration loading. Whilst the generated TOML configuration
wasn't the best, it was completely valid, whereas after the
aforementioned PR it was no longer valid.
This commit is contained in:
andre4ik3 2025-04-11 17:17:15 +04:00 committed by GitHub
parent f0c69ede70
commit 6bccb54a4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2 additions and 54 deletions

View file

@ -35,27 +35,6 @@ let
) (lib.attrNames set)
);
filterNulls = filterListAndAttrsRecursive (v: v != null);
# Turns
# {if = {foo = "xxx"; bar = "yyy"}}
# into
# {"if.foo" = "xxx"; "if.bar" = "yyy"}
# so that the correct TOML is generated for the
# on-window-detected table.
flattenConditions =
attrs:
let
conditions = attrs."if" or { };
in
builtins.removeAttrs attrs [ "if" ] // lib.concatMapAttrs (n: v: { "if.${n}" = v; }) conditions;
flattenOnWindowDetected =
cfg:
let
owd = cfg.on-window-detected or [ ];
in
cfg // { on-window-detected = map flattenConditions owd; };
in
{
meta.maintainers = with lib.hm.maintainers; [ damidoug ];
@ -291,7 +270,7 @@ in
home = {
packages = lib.mkIf (cfg.package != null) [ cfg.package ];
file.".config/aerospace/aerospace.toml".source = tomlFormat.generate "aerospace" (
filterNulls (flattenOnWindowDetected cfg.userSettings)
filterNulls cfg.userSettings
);
};
};