if [ "${BONFIRE_DEV_GUIX}" = "true" ]; then
  # not sure if this is useful at all or if it could be useful also for nix
  # it comes from
  # https://web.archive.org/web/20240207222746/https://lists.gnu.org/archive/html/help-guix/2021-01/msg00166.html
  mkdir -p .guix-mix
  mkdir -p .guix-hex
  export MIX_HOME="${PWD}/.guix-mix"
  export HEX_HOME="${PWD}/.guix-hex"
  PATH_add "${MIX_HOME}/bin"
  PATH_add "${HEX_HOME}/bin"

  export WITH_DOCKER=partial

  use guix git-cal -m manifest.scm

  clear
  git-cal --author="$(git config user.name)"
else
  use flake
  watch_file deps.nix
  watch_file props.nix
  export WITH_DOCKER=no
fi


function env_file_watch {
  config_file_path="config/${MIX_ENV:-dev}"
  config_file="${config_file_path}/.env"
  if [[ -f ${config_file} ]]; then
    watch_file ${config_file}
    dotenv ${config_file}
  fi
}

env_file_watch
