diff --git a/modules/services/aerospace/default.nix b/modules/services/aerospace/default.nix index e4732899a..496d93e47 100644 --- a/modules/services/aerospace/default.nix +++ b/modules/services/aerospace/default.nix @@ -3,38 +3,37 @@ lib, pkgs, ... -}: +}: let cfg = config.services.aerospace; - format = pkgs.formats.toml { }; - filterAttrsRecursive = - pred: set: + filterAttrsRecursive = pred: set: lib.listToAttrs ( lib.concatMap ( - name: - let + name: let v = set.${name}; in - if pred v then - [ + if pred v + then [ (lib.nameValuePair name ( - if lib.isAttrs v then - filterAttrsRecursive pred v - else if lib.isList v then - (map (i: if lib.isAttrs i then filterAttrsRecursive pred i else i) (lib.filter pred v)) - else - v + if lib.isAttrs v + then filterAttrsRecursive pred v + else if lib.isList v + then + (map (i: + if lib.isAttrs i + then filterAttrsRecursive pred i + else i) (lib.filter pred v)) + else v )) ] - else - [ ] + else [] ) (lib.attrNames set) ); filterNulls = filterAttrsRecursive (v: v != null); configFile = format.generate "aerospace.toml" (filterNulls cfg.settings); -in +in { options = { @@ -124,7 +123,7 @@ in during-aerospace-startup = lib.mkOption { type = nullOr bool; default = null; - description = "Whether to match during aerospace startup (optional)."; + description = "Whether to match during aerospace startup (optional)."; }; }; }; @@ -137,8 +136,8 @@ in description = "Whether to check further callbacks after this rule (optional)."; }; run = lib.mkOption { - type = oneOf [ str (listOf str) ]; - example = [ "move-node-to-workspace m" "resize-node" ]; + type = oneOf [str (listOf str)]; + example = ["move-node-to-workspace m" "resize-node"]; description = "Commands to execute when the conditions match (required)."; }; }; @@ -160,7 +159,7 @@ in description = "Commands to run every time a new window is detected with optional conditions."; }; workspace-to-monitor-force-assignment = lib.mkOption { - type = attrsOf (oneOf [ int str (listOf str) ]); + type = attrsOf (oneOf [int str (listOf str)]); default = { }; description = '' Map workspaces to specific monitors.