#!/bin/bash do_devenv() { pushd ~/.dotfiles || return printf "Updating \033[38;5;87mdevenv\033[0m \n" nix flake update popd || return } do_home_manager() { pushd ./home-manager || return printf "Updating \033[38;5;87mhome-manager\033[0m\n" nix flake update if [[ $(uname) == "Darwin" ]]; then home-manager switch --flake ".#aarch64-darwin-acicchetti" else home-manager switch --flake '.#x86_64-linux-acicchetti' fi popd || return } OPTIND=1 while getopts dh opt; do case $opt in d) do_devenv ;; h) do_home_manager ;; *) exit 1 ;; esac done shift "$((OPTIND - 1))" # Discard the options and sentinel --