# Nushell + Plugins Distribution Configuration
# Configuration file for the full distribution system

[distribution]
# Distribution metadata
name = "Nushell + Plugins"
description = "Complete Nushell distribution with built-in and custom plugins"
version = "0.107.1"
homepage = "https://nushell.sh"
repository = "https://github.com/your-org/nushell-plugins"

# Distribution maintainer information
[distribution.maintainer]
name = "Nushell Plugins Team"
email = "maintainer@your-domain.com"
organization = "Your Organization"

# Release information
[distribution.release]
# Release channels: stable, beta, nightly
channel = "stable"
# Build types: release, debug, profiling
build_type = "release"
# Supported architectures
architectures = [
    "x86_64-unknown-linux-gnu",
    "aarch64-unknown-linux-gnu",
    "x86_64-apple-darwin",
    "aarch64-apple-darwin",
    "x86_64-pc-windows-msvc",
    "aarch64-pc-windows-msvc"
]

# Platform-specific configurations
[platforms.linux]
package_formats = ["tar.gz"]
install_prefix_user = "$HOME/.local"
install_prefix_system = "/usr/local"
shell_configs = [
    "$HOME/.bashrc",
    "$HOME/.zshrc",
    "$HOME/.config/fish/config.fish",
    "$HOME/.profile"
]

[platforms.macos]
package_formats = ["tar.gz"]
install_prefix_user = "$HOME/.local"
install_prefix_system = "/usr/local"
shell_configs = [
    "$HOME/.bash_profile",
    "$HOME/.zshrc",
    "$HOME/.config/fish/config.fish",
    "$HOME/.profile"
]

[platforms.windows]
package_formats = ["zip"]
install_prefix_user = "%USERPROFILE%\\.local"
install_prefix_system = "%ProgramFiles%\\Nushell"
registry_keys = [
    "HKCU\\Environment",
    "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"
]

# Nushell configuration
[nushell]
# Nushell source directory (relative to project root)
source_dir = "nushell"
# Features to enable when building nushell
features = [
    "plugin",
    "network",
    "sqlite",
    "trash-support",
    "rustls-tls",
    "system-clipboard"
]
# Build profile
profile = "release"
# Additional build flags
build_flags = ["--locked"]

# Workspace plugins (built with nushell)
[plugins.workspace]
# Enable all workspace plugins by default
enabled = true
# Specific workspace plugins to include
plugins = [
    "nu_plugin_custom_values",
    "nu_plugin_example",
    "nu_plugin_formats",
    "nu_plugin_gstat",
    "nu_plugin_inc",
    "nu_plugin_polars",
    "nu_plugin_query",
    "nu_plugin_stress_internals"
]

# Custom plugins (external to nushell workspace)
[plugins.custom]
# Enable custom plugins by default
enabled = true
# Specific custom plugins to include
plugins = [
    "nu_plugin_clipboard",
    "nu_plugin_desktop_notifications",
    "nu_plugin_fluent",
    "nu_plugin_hashes",
    "nu_plugin_highlight",
    "nu_plugin_image",
    "nu_plugin_kcl",
    "nu_plugin_port_extension",
    "nu_plugin_qr_maker",
    "nu_plugin_tera"
]

# Plugin-specific configurations
[plugins.custom.nu_plugin_clipboard]
description = "Cross-platform clipboard access"
required_system_deps = ["xclip", "wl-clipboard"] # Linux only

[plugins.custom.nu_plugin_desktop_notifications]
description = "Desktop notification support"
required_system_deps = ["libnotify"] # Linux only

[plugins.custom.nu_plugin_highlight]
description = "Syntax highlighting for code files"
optional_deps = ["bat", "pygments"]

[plugins.custom.nu_plugin_image]
description = "Image processing and viewing"
optional_deps = ["imagemagick", "ffmpeg"]

[plugins.custom.nu_plugin_tera]
description = "Template processing with Tera"

# Build configuration
[build]
# Parallel jobs for building
jobs = 0  # 0 = auto-detect
# Target directory for builds
target_dir = "target"
# Whether to use cargo workspaces
use_workspace = true
# Additional cargo flags
cargo_flags = ["--release", "--locked"]
# Environment variables for build
env_vars = {}

# Cross-compilation settings
[build.cross]
# Enable cross-compilation
enabled = true
# Cross-compilation tool (cross, cargo-zigbuild, etc.)
tool = "cross"
# Docker image for cross-compilation
docker_image = "ghcr.io/cross-rs/cross"

# Collection settings
[collection]
# Output directory for collected binaries
output_dir = "distribution"
# Whether to include nushell binary
include_nushell = true
# Whether to include workspace plugins
include_workspace_plugins = true
# Whether to include custom plugins
include_custom_plugins = true
# Files to copy to distribution
additional_files = [
    "LICENSE",
    "README.md",
    "CHANGELOG.md"
]
# Directories to copy
additional_dirs = [
    "scripts/templates"
]

# Packaging settings
[packaging]
# Output directory for packages
output_dir = "bin_archives"
# Package formats per platform
formats = {
    linux = ["tar.gz"],
    macos = ["tar.gz"],
    windows = ["zip"]
}
# Compression level (0-9)
compression_level = 6
# Whether to generate checksums
generate_checksums = true
# Checksum algorithms
checksum_algorithms = ["sha256", "sha512"]

# Manifest settings
[packaging.manifest]
# Include detailed manifest in packages
enabled = true
# Manifest format (json, toml, yaml)
format = "json"
# Include build information
include_build_info = true
# Include system information
include_system_info = true
# Include plugin information
include_plugin_info = true

# Installation settings
[installation]
# Default configuration templates
config_templates = {
    env = "scripts/templates/default_env.nu",
    config = "scripts/templates/default_config.nu"
}
# Whether to create config directory
create_config_dir = true
# Whether to update PATH
update_path = true
# Whether to auto-register plugins
auto_register_plugins = true
# Shell integration scripts
shell_scripts = [
    "installers/bootstrap/install.sh",
    "installers/bootstrap/install.ps1"
]

# Verification settings
[verification]
# Enable installation verification
enabled = true
# Tests to run during verification
tests = [
    "version_check",
    "basic_functionality",
    "plugin_list",
    "path_check"
]
# Timeout for verification tests (seconds)
timeout = 30

# Update and maintenance
[maintenance]
# Automatic dependency updates
auto_update_deps = false
# Security advisory checks
security_checks = true
# Cleanup old builds
cleanup_builds = true
# Maximum build artifacts to keep
max_build_artifacts = 5

# CI/CD integration
[ci]
# Supported CI platforms
platforms = ["github", "gitlab", "jenkins"]
# Artifact retention (days)
artifact_retention = 30
# Test matrix
test_matrix = [
    "ubuntu-latest",
    "macos-latest",
    "windows-latest"
]

# Release automation
[release]
# Automatic releases on tag
auto_release = true
# Release notes generation
generate_release_notes = true
# Pre-release validation
validate_before_release = true
# Release channels
channels = {
    stable = "main",
    beta = "develop",
    nightly = "nightly"
}

# Documentation settings
[documentation]
# Generate documentation during build
generate_docs = true
# Documentation formats
formats = ["html", "markdown"]
# Include API documentation
include_api_docs = true
# Documentation output directory
output_dir = "docs"

# Logging and monitoring
[logging]
# Log level (error, warn, info, debug, trace)
level = "info"
# Log format (compact, full, json)
format = "compact"
# Log to file
file_logging = false
# Log file path
log_file = "build.log"

# Security settings
[security]
# Code signing (for releases)
code_signing = false
# GPG signing key
gpg_key = ""
# Vulnerability scanning
vulnerability_scan = true
# Supply chain verification
supply_chain_check = true

# Analytics and telemetry
[analytics]
# Usage analytics (anonymized)
enabled = false
# Analytics endpoint
endpoint = ""
# Data retention period
retention_days = 90

# Custom hooks and scripts
[hooks]
# Pre-build hooks
pre_build = []
# Post-build hooks
post_build = []
# Pre-package hooks
pre_package = []
# Post-package hooks
post_package = []
# Pre-release hooks
pre_release = []
# Post-release hooks
post_release = []

# Feature flags
[features]
# Experimental features
experimental_features = false
# Beta features
beta_features = false
# Development features
dev_features = false

# Custom settings (user-configurable)
[custom]
# User can add any additional settings here
# These will be preserved during updates