mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08: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:
@@ -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
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -14,26 +14,6 @@
|
||||
alt-k = "focus up";
|
||||
alt-l = "focus right";
|
||||
};
|
||||
on-window-detected = [
|
||||
{
|
||||
"if" = {
|
||||
app-id = "com.apple.MobileSMS";
|
||||
};
|
||||
run = [ "move-node-to-workspace 10" ];
|
||||
}
|
||||
{
|
||||
"if" = {
|
||||
app-id = "ru.keepcoder.Telegram";
|
||||
};
|
||||
run = [ "move-node-to-workspace 10" ];
|
||||
}
|
||||
{
|
||||
"if" = {
|
||||
app-id = "org.whispersystems.signal-desktop";
|
||||
};
|
||||
run = [ "move-node-to-workspace 10" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ enable-normalization-opposite-orientation-for-nested-containers = true
|
||||
exec-on-workspace-change = []
|
||||
on-focus-changed = []
|
||||
on-focused-monitor-changed = ["move-mouse monitor-lazy-center"]
|
||||
on-window-detected = []
|
||||
start-at-login = false
|
||||
|
||||
[gaps.outer]
|
||||
@@ -24,15 +25,3 @@ alt-h = "focus left"
|
||||
alt-j = "focus down"
|
||||
alt-k = "focus up"
|
||||
alt-l = "focus right"
|
||||
|
||||
[[on-window-detected]]
|
||||
"if.app-id" = "com.apple.MobileSMS"
|
||||
run = ["move-node-to-workspace 10"]
|
||||
|
||||
[[on-window-detected]]
|
||||
"if.app-id" = "ru.keepcoder.Telegram"
|
||||
run = ["move-node-to-workspace 10"]
|
||||
|
||||
[[on-window-detected]]
|
||||
"if.app-id" = "org.whispersystems.signal-desktop"
|
||||
run = ["move-node-to-workspace 10"]
|
||||
|
||||
Reference in New Issue
Block a user