function push() {
    git add -A
    if [ -z "$*" ]; then
        git commit -m "$(date)"
    else
        git commit -m "$*"
    fi
    git push
}

function run() {
  NIXPKGS_ALLOW_UNFREE=1 nix run --impure "nixpkgs#$1" -- "${@:2}"
}

function y() {
	local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
	yazi "$@" --cwd-file="$tmp"
	IFS= read -r -d '' cwd < "$tmp"
	[ -n "$cwd" ] && [ "$cwd" != "$PWD" ] && builtin cd -- "$cwd"
	rm -f -- "$tmp"
}
