prvng_core/nulib/sops_env.nu
Jesús Pérez 85ce530733
feat: update provisioning core CLI, libraries, and plugins
Update core components including CLI, Nushell libraries, plugins system,
and utility scripts for the provisioning system.

CLI Updates:
- Command implementations
- CLI utilities and dispatching
- Help system improvements
- Command validation

Library Updates:
- Configuration management system
- Infrastructure validation
- Extension system improvements
- Secrets management
- Workspace operations
- Cache management system

Plugin System:
- Interactive form plugin (inquire)
- KCL integration plugin
- Performance optimization plugins
- Plugin registration system

Utilities:
- Build and distribution scripts
- Installation procedures
- Testing utilities
- Development tools

Documentation:
- Library module documentation
- Extension API guides
- Plugin usage guides
- Service management documentation

All changes are backward compatible. No breaking changes.
2025-12-11 21:57:05 +00:00

29 lines
1.4 KiB
Plaintext

export-env {
if $env.CURRENT_INFRA_PATH != null and $env.CURRENT_INFRA_PATH != "" {
#use sops/lib.nu get_def_sops
#use sops/lib.nu get_def_age
if $env.CURRENT_KLOUD_PATH? != null {
$env.PROVISIONING_SOPS = (get_def_sops $env.CURRENT_KLOUD_PATH)
$env.PROVISIONING_KAGE = (get_def_age $env.CURRENT_KLOUD_PATH)
} else {
$env.PROVISIONING_SOPS = (get_def_sops $env.CURRENT_INFRA_PATH)
$env.PROVISIONING_KAGE = (get_def_age $env.CURRENT_INFRA_PATH)
# let context = (setup_user_context)
# let kage_path = ($context | try { get "kage_path" } catch { "" | str replace "KLOUD_PATH" $env.PROVISIONING_KLOUD_PATH) }
# if $kage_path != "" {
# $env.PROVISIONING_KAGE = $kage_path
# }
}
print $env
if $env.PROVISIONING_KAGE? != null {
$env.SOPS_AGE_KEY_FILE = $env.PROVISIONING_KAGE
let key_parts = (grep "public key:" $env.SOPS_AGE_KEY_FILE | split row ":")
$env.SOPS_AGE_RECIPIENTS = if ($key_parts | length) > 1 { $key_parts | get 1 | str trim } else { "" }
if $env.SOPS_AGE_RECIPIENTS == "" {
print $"❗Error no key found in (_ansi red_bold)($env.SOPS_AGE_KEY_FILE)(_ansi reset) file for secure AGE operations "
exit 1
}
}
}
}