Skip to content

Commit 28d91e4

Browse files
committed
feat: add platform-specific rebuild aliases and zoxide cd alias
- Add nixswitch/darwin-rebuild aliases for macOS using scutil hostname detection - Add hmswitch/hm-user aliases for Linux using home-manager - Add cd -> z alias to use zoxide for smarter directory navigation - Maintain platform compatibility by keeping rebuild commands separate
1 parent ea15d1d commit 28d91e4

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

common/zsh/shared.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ rec {
1818
vim = "nvim";
1919
cat = "bat";
2020
tree = "tree -C";
21+
cd = "z"; # Use zoxide for smarter directory navigation
2122

2223
# Nix utilities (platform-agnostic)
2324
nix-shell-pure = "nix-shell --pure";

systems/aarch64-darwin/home.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,12 @@
66

77
# macOS-specific home directory
88
home.homeDirectory = "/Users/${username}";
9+
10+
# macOS-specific shell aliases
11+
programs.zsh.shellAliases = {
12+
nixswitch =
13+
"sudo darwin-rebuild switch --flake ~/.config/nix#$(scutil --get LocalHostName)";
14+
darwin-rebuild =
15+
"sudo darwin-rebuild switch --flake ~/.config/nix#$(scutil --get LocalHostName)";
16+
};
917
}

systems/aarch64-linux/home-linux.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
# Linux-specific session variables
1919
home.sessionVariables = { EDITOR = "nvim"; };
2020

21+
# Linux-specific shell aliases
22+
programs.zsh.shellAliases = {
23+
hmswitch = "home-manager switch --flake ~/.config/nix#linux";
24+
hm-user = "home-manager switch --flake ~/.config/nix#$(whoami)";
25+
};
26+
2127
# Linux-specific ZSH initialization
2228
programs.zsh.initContent = ''
2329
# Load worktree manager

0 commit comments

Comments
 (0)