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:
+4
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user