#!/usr/bin/env bash

set -eu

GUILE_INSTALL_LOCALE=0
export GUILE_INSTALL_LOCALE

GUIX_BUILD_OPTIONS=''
export GUIX_BUILD_OPTIONS

IHS_USER=pyhalov
export IHS_USER

IHS_PASS="$(pass show majordomo/private/hms/pyhalov)"
export IHS_PASS

CVM_USER=cron
export CVM_USER

CVM_PASS="$(pass show majordomo/private/cvm/cron)"
export CVM_PASS

case "$1" in
    task-delete)
        python3 -c "exec(open('/home/oleg/.pythonrc').read()); hms_task_delete($2)"
        ;;
    *)
        command ihs "$@"
        ;;
esac
