{ pkgs, ... }: with pkgs.nodePackages; '' # Script to set the docker, triton, manta and CNS env vars for the current # triton profile # Docs: https://docs.greenbaum.cloud/en/devops/triton-cli.html # triton CLI source: https://github.com/tritonDataCenter/node-triton cnsBaseDomain=$TRITONSHELL_CNS_BASE_DOMAIN mantaDomain=$TRITONSHELL_MANTA_DOMAIN tritonApiDomain=$TRITONSHELL_TRITON_API_DOMAIN if [ -n "$ZSH_VERSION" ]; then IFS=" " read -r -A dataCenters <<< "$TRITONSHELL_DATA_CENTERS" elif [ -n "$BASH_VERSION" ]; then # https://github.com/koalaman/shellcheck/wiki/SC2206 IFS=" " read -r -a dataCenters <<< "$TRITONSHELL_DATA_CENTERS" fi # Set triton and docker host environment variables eval "$(${triton}/bin/triton env)" # Get the user's UUID triton_account_uuid="$(${triton}/bin/triton account get --json | ${json}/bin/json id)" # Set the CNS (container name service) base domain for auto-generated DNS # records in public and private networks # Note: the defaults are configured to work with our data centers, adjust the # nix module options like config.environment.cnsBaseDomain in your devshell # if you'd like to use tritonshell with your own, self-hosted TritonDataCenter for dc in "''${dataCenters[@]}"; do if env | grep -q -E "SDC_URL=https://''${dc}.''${tritonApiDomain}"; then export \ TRITON_CNS_SEARCH_DOMAIN_PUBLIC="''${triton_account_uuid}.''${dc}.''${cnsBaseDomain}" \ TRITON_CNS_SEARCH_DOMAIN_PRIVATE="''${triton_account_uuid}.''${dc}.int.''${cnsBaseDomain}" \ TRITON_DC=''$dc fi done export MANTA_URL=https://''${mantaDomain} export MANTA_USER=$SDC_ACCOUNT export MANTA_KEY_ID=$SDC_KEY_ID ''