fix: rebuild abbreviation 自动从 hostname 推导 flake attr

hostname awesome-mac-mini → flake attr mac-mini
hostname awesome-macbook-air → flake attr macbook-air
WSL 硬编码 #wsl(唯一 NixOS host)
This commit is contained in:
2026-04-11 00:14:17 +08:00
parent 52836c0490
commit ac7f9f8b8a
2 changed files with 7 additions and 4 deletions
+3 -1
View File
@@ -2,11 +2,13 @@
active: true
iteration: 3
max_iterations: 500
completion_promise: "DONE"
completion_promise: "VERIFIED"
initial_completion_promise: "DONE"
verification_attempt_id: "89113c03-711f-4bdb-a42c-710b7726f431"
started_at: "2026-04-10T15:59:34.105Z"
session_id: "ses_28863d32affeOW6Iiz2415uZSk"
ultrawork: true
verification_pending: true
strategy: "continue"
message_count_at_start: 191
---
+4 -3
View File
@@ -41,11 +41,12 @@
# Sudo: double Escape to prepend sudo
bind \e\e 'fish_commandline_prepend sudo'
# Platform-specific rebuild command
# Platform-specific rebuild command (derive flake attr from hostname)
if test (uname) = Darwin
abbr --add rebuild "sudo darwin-rebuild switch --flake ~/Developer/nix-config"
set -l attr (scutil --get LocalHostName | string lower | string replace 'awesome-' '')
abbr --add rebuild "sudo darwin-rebuild switch --flake ~/Developer/nix-config#$attr"
else
abbr --add rebuild "sudo nixos-rebuild switch --flake ~/Developer/nix-config"
abbr --add rebuild "sudo nixos-rebuild switch --flake ~/Developer/nix-config#wsl"
end
# WSL clipboard