zsh: add switch function

This commit is contained in:
2023-07-04 03:31:13 +00:00
parent 61cbdc2c85
commit 8bd2ad0456

View File

@@ -171,7 +171,7 @@ in
# see for an example: <https://filipe.kiss.ink/zmv-zsh-rename/>
autoload -Uz zmv
HISTORY_IGNORE='(sane-shutdown *|sane-reboot *|rm *|nixos-rebuild.* switch)'
HISTORY_IGNORE='(sane-shutdown *|sane-reboot *|rm *|nixos-rebuild.* switch|switch)'
# extra aliases
# TODO: move to `shellAliases` config?
@@ -179,6 +179,10 @@ in
mkdir -p "$1";
pushd "$1";
}
function switch() {
sudo nixos-rebuild --flake . switch;
}
'';
syntaxHighlighting.enable = true;