add aerospace to darwin hosts

This commit is contained in:
Yan Lin 2025-11-16 14:46:07 +01:00
parent d0f891e144
commit 35578e5cdc
4 changed files with 171 additions and 10 deletions

47
flake.lock generated
View file

@ -36,6 +36,31 @@
"type": "github" "type": "github"
} }
}, },
"cuda-legacy": {
"inputs": {
"flake-parts": [
"jetpack-nixos",
"cuda-legacy"
],
"nixpkgs": [
"jetpack-nixos",
"nixpkgs"
]
},
"locked": {
"lastModified": 1762806692,
"narHash": "sha256-JhgQIwJe0U2vxj+pu+Sgm+VLgNqucpXtZYGKZOgkQdc=",
"owner": "nixos-cuda",
"repo": "cuda-legacy",
"rev": "9856d70acc3e2ae9081930b33d946326e07f1482",
"type": "github"
},
"original": {
"owner": "nixos-cuda",
"repo": "cuda-legacy",
"type": "github"
}
},
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -183,6 +208,27 @@
"type": "github" "type": "github"
} }
}, },
"jetpack-nixos": {
"inputs": {
"cuda-legacy": "cuda-legacy",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1763139565,
"narHash": "sha256-Y6egKi46ui+26iUlfd71SjND3dHO2TDsn7Y5AeuQ+Ek=",
"owner": "anduril",
"repo": "jetpack-nixos",
"rev": "f538b3b3b0cb7d42ed34c0841af262e74c3c7066",
"type": "github"
},
"original": {
"owner": "anduril",
"repo": "jetpack-nixos",
"type": "github"
}
},
"jovian-nixos": { "jovian-nixos": {
"inputs": { "inputs": {
"nix-github-actions": "nix-github-actions", "nix-github-actions": "nix-github-actions",
@ -349,6 +395,7 @@
"disko": "disko", "disko": "disko",
"firefox-addons": "firefox-addons", "firefox-addons": "firefox-addons",
"home-manager": "home-manager", "home-manager": "home-manager",
"jetpack-nixos": "jetpack-nixos",
"jovian-nixos": "jovian-nixos", "jovian-nixos": "jovian-nixos",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nix-homebrew": "nix-homebrew", "nix-homebrew": "nix-homebrew",

View file

@ -21,6 +21,7 @@
../../modules/claude-code.nix ../../modules/claude-code.nix
../../modules/tex.nix ../../modules/tex.nix
../../modules/fonts.nix ../../modules/fonts.nix
../../modules/aerospace.nix
]; ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@ -198,15 +199,6 @@
}; };
}; };
launchd.agents.rectangle = {
enable = true;
config = {
ProgramArguments = [ "/Applications/Rectangle.app/Contents/MacOS/Rectangle" ];
RunAtLoad = true;
KeepAlive = false;
};
};
launchd.agents.maccy = { launchd.agents.maccy = {
enable = true; enable = true;
config = { config = {

123
modules/aerospace.nix Normal file
View file

@ -0,0 +1,123 @@
{ config, pkgs, ... }:
{
# Install aerospace package
home.packages = [ pkgs.aerospace ];
# AeroSpace configuration following Hyprland keybindings
xdg.configFile."aerospace/aerospace.toml".text = ''
# Reference: https://github.com/nikitabobko/AeroSpace/blob/main/docs/config-reference.md
# Behavior settings
after-login-command = []
after-startup-command = []
start-at-login = true
# Normalizations
enable-normalization-flatten-containers = true
enable-normalization-opposite-orientation-for-nested-containers = true
# Gaps (matching Hyprland: no gaps)
accordion-padding = 0
# Default root container layout
default-root-container-layout = 'tiles'
# Default container orientation
default-root-container-orientation = 'auto'
# Mouse follows focus
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
# Workspace to monitor assignment (macOS native displays)
[workspace-to-monitor-force-assignment]
1 = 'main'
2 = 'main'
3 = 'main'
4 = 'main'
5 = 'main'
6 = 'main'
7 = 'main'
8 = 'main'
9 = 'main'
# Mode definitions
[mode.main.binding]
# Core window management (matching Hyprland: Super+Q/F/V)
# Using alt instead of cmd to avoid macOS conflicts
alt-q = 'close'
alt-f = 'fullscreen'
alt-shift-space = 'layout floating tiling' # Toggle float/tile
# Window focus navigation (vim-style: alt+h/j/k/l)
alt-h = 'focus left'
alt-j = 'focus down'
alt-k = 'focus up'
alt-l = 'focus right'
# Window moving/swapping (matching Hyprland: Ctrl+hjkl)
alt-ctrl-h = 'move left'
alt-ctrl-j = 'move down'
alt-ctrl-k = 'move up'
alt-ctrl-l = 'move right'
# Window resizing (matching Hyprland: Shift+hjkl)
alt-shift-h = 'resize width -50'
alt-shift-j = 'resize height +50'
alt-shift-k = 'resize height -50'
alt-shift-l = 'resize width +50'
# Workspace navigation (1-9, matching Hyprland exactly)
alt-1 = 'workspace 1'
alt-2 = 'workspace 2'
alt-3 = 'workspace 3'
alt-4 = 'workspace 4'
alt-5 = 'workspace 5'
alt-6 = 'workspace 6'
alt-7 = 'workspace 7'
alt-8 = 'workspace 8'
alt-9 = 'workspace 9'
# Move window to workspace (Shift+1-9, matching Hyprland)
alt-shift-1 = 'move-node-to-workspace 1'
alt-shift-2 = 'move-node-to-workspace 2'
alt-shift-3 = 'move-node-to-workspace 3'
alt-shift-4 = 'move-node-to-workspace 4'
alt-shift-5 = 'move-node-to-workspace 5'
alt-shift-6 = 'move-node-to-workspace 6'
alt-shift-7 = 'move-node-to-workspace 7'
alt-shift-8 = 'move-node-to-workspace 8'
alt-shift-9 = 'move-node-to-workspace 9'
# Layout management
alt-slash = 'layout tiles horizontal vertical'
alt-comma = 'layout accordion horizontal vertical'
# Service mode for aerospace-specific commands
alt-shift-semicolon = 'mode service'
# See: https://nikitabobko.github.io/AeroSpace/commands#mode
[mode.service.binding]
esc = ['reload-config', 'mode main']
r = ['flatten-workspace-tree', 'mode main']
f = ['layout floating tiling', 'mode main']
backspace = ['close-all-windows-but-current', 'mode main']
alt-shift-h = ['join-with left', 'mode main']
alt-shift-j = ['join-with down', 'mode main']
alt-shift-k = ['join-with up', 'mode main']
alt-shift-l = ['join-with right', 'mode main']
'';
# Setup launchd agent for auto-start
launchd.agents.aerospace = {
enable = true;
config = {
ProgramArguments = [ "${pkgs.aerospace}/Applications/AeroSpace.app/Contents/MacOS/AeroSpace" ];
RunAtLoad = true;
KeepAlive = false;
};
};
}

View file

@ -27,7 +27,6 @@
"microsoft-powerpoint" "microsoft-powerpoint"
"microsoft-word" "microsoft-word"
"microsoft-excel" "microsoft-excel"
"rectangle"
"balenaetcher" "balenaetcher"
]; ];
taps = [ taps = [