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

aerospace: simplify userSettings

Remove submodule and just use the generator type.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-11-03 21:21:08 -06:00
parent 7f619d2a72
commit 432bc8a5da
3 changed files with 1 additions and 133 deletions

View file

@ -99,117 +99,7 @@ in
};
userSettings = mkOption {
type = types.submodule {
freeformType = tomlFormat.type;
options = {
after-startup-command = mkOption {
type = with types; listOf str;
default = [ ];
description = ''
A list of AeroSpace commands to execute immediately after the AeroSpace application starts.
These commands are written to your `aerospace.toml` config file and are run after the `after-login-command` sequence.
A list of all available commands can be found at <https://nikitabobko.github.io/AeroSpace/commands>.
While this module checks for valid command names, using incorrect *arguments* can still cause issues.
If AeroSpace is not behaving correctly after startup, check the logs for errors with `cat /tmp/aerospace.err.log`.
'';
example = [
"exec-and-forget open -n /System/Applications/Utilities/Terminal.app"
"layout tiles accordion"
];
};
enable-normalization-flatten-containers = mkOption {
type = types.bool;
default = true;
description = ''Containers that have only one child are "flattened".'';
};
enable-normalization-opposite-orientation-for-nested-containers = mkOption {
type = types.bool;
default = true;
description = "Containers that nest into each other must have opposite orientations.";
};
accordion-padding = mkOption {
type = types.int;
default = 30;
description = "Padding between windows in an accordion container.";
};
default-root-container-layout = mkOption {
type = types.enum [
"tiles"
"accordion"
];
default = "tiles";
description = "Default layout for the root container.";
};
default-root-container-orientation = mkOption {
type = types.enum [
"horizontal"
"vertical"
"auto"
];
default = "auto";
description = "Default orientation for the root container.";
};
workspace-to-monitor-force-assignment = mkOption {
type =
with types;
nullOr (
attrsOf (oneOf [
int
str
(listOf str)
])
);
default = null;
description = ''
Map workspaces to specific monitors.
Left-hand side is the workspace name, and right-hand side is the monitor pattern.
'';
example = {
"1" = 1; # First monitor from left to right.
"2" = "main"; # Main monitor.
"3" = "secondary"; # Secondary monitor (non-main).
"4" = "built-in"; # Built-in display.
"5" = "^built-in retina display$"; # Regex for the built-in retina display.
"6" = [
"secondary"
"dell"
]; # Match first pattern in the list.
};
};
on-focus-changed = mkOption {
type = with types; listOf str;
default = [ ];
example = [ "move-mouse monitor-lazy-center" ];
description = "Commands to run every time focused window or workspace changes.";
};
on-focused-monitor-changed = mkOption {
type = with types; listOf str;
default = [ "move-mouse monitor-lazy-center" ];
description = "Commands to run every time focused monitor changes.";
};
exec-on-workspace-change = mkOption {
type = with types; listOf str;
default = [ ];
example = [
"/bin/bash"
"-c"
"sketchybar --trigger aerospace_workspace_change FOCUSED_WORKSPACE=$AEROSPACE_FOCUSED_WORKSPACE"
];
description = "Commands to run every time workspace changes.";
};
key-mapping.preset = mkOption {
type = types.enum [
"qwerty"
"dvorak"
"colemak"
];
default = "qwerty";
description = "Keymapping preset.";
};
};
};
inherit (tomlFormat) type;
default = { };
example = lib.literalExpression ''
{

View file

@ -1,13 +1,3 @@
accordion-padding = 30
after-startup-command = []
default-root-container-layout = "tiles"
default-root-container-orientation = "auto"
enable-normalization-flatten-containers = true
enable-normalization-opposite-orientation-for-nested-containers = true
exec-on-workspace-change = []
on-focus-changed = []
on-focused-monitor-changed = ["move-mouse monitor-lazy-center"]
[gaps.outer]
bottom = 8
left = 8

View file

@ -1,13 +1,4 @@
accordion-padding = 30
after-login-command = []
after-startup-command = []
default-root-container-layout = "tiles"
default-root-container-orientation = "auto"
enable-normalization-flatten-containers = true
enable-normalization-opposite-orientation-for-nested-containers = true
exec-on-workspace-change = []
on-focus-changed = []
on-focused-monitor-changed = ["move-mouse monitor-lazy-center"]
start-at-login = false
[gaps.outer]
@ -16,9 +7,6 @@ left = 8
right = 8
top = 8
[key-mapping]
preset = "qwerty"
[mode.main.binding]
alt-h = "focus left"
alt-j = "focus down"