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 commits95861b5d9fandd2c014e1c7(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:
parent
f0c69ede70
commit
6bccb54a4f
3 changed files with 2 additions and 54 deletions
|
|
@ -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
|
||||
);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue