Allow specifying username in nix-deploy

This commit is contained in:
2025-10-05 10:24:34 +00:00
parent 0bf3d27d02
commit 41090b07b2

6
.zshrc
View File

@@ -90,11 +90,13 @@ nix-deploy() {
shift
fi
if [ $# -gt 0 ]; then
TARGET=$1
TARGET_HOST=$1 # user@host.domain
TARGET_WITH_DOMAIN=${TARGET_HOST#*@} # host.domain
TARGET=${TARGET_WITH_DOMAIN%%.*} # host
shift
nix run nixpkgs#nixos-rebuild -- "${COMMAND?}" \
--flake ".#${TARGET?}" \
--target-host "${TARGET?}" \
--target-host "${TARGET_HOST?}" \
--use-remote-sudo \
--fast "$@"
else