2025-06-27 01:26:44 +01:00
|
|
|
# Nushell plugins for Provisioning
|
|
|
|
|
|
|
|
A [Nushell](https://nushell.sh/) plugins collection for [Provisioning project](https://rlung.librecloud.online/jesus/provisioning)
|
|
|
|
|
|
|
|
>[!WARNING]
|
|
|
|
> This repo contains sub-repos, use git clone --recurse-submodules
|
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone --recurse-submodules [URL-to-clone-nushell-plugin]
|
|
|
|
```
|
|
|
|
|
|
|
|
> [!CAUTION]
|
|
|
|
> **nu_plugin_*** have dependencies to nushell source via local path in Cargo.toml
|
|
|
|
> Nushell and plugins require to be **sync** with same version
|
|
|
|
|
|
|
|
## FILES (content layout)
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
.
|
|
|
|
├── collect-install.sh Script to collect all nu_plugin_* and install in /usr/local/bin
|
2025-06-27 03:36:46 +01:00
|
|
|
├── env Main value settings
|
2025-06-27 04:36:21 +01:00
|
|
|
├── pack-dist.sh Script to archive **distribution** nu_plugin_* as architecture-platform.tar.gz
|
2025-06-27 01:26:44 +01:00
|
|
|
├── distribution
|
2025-06-27 04:36:21 +01:00
|
|
|
│ ├── collect-install.sh Script to build and collect nu_plugin_*
|
|
|
|
│ ├── install.sh Script to install nu_plugin_* binaries
|
2025-06-27 07:55:18 +01:00
|
|
|
│ ├── kcl-install.sh Script to install KCL
|
2025-06-27 04:36:21 +01:00
|
|
|
│ ├── install_nu_plugins.nu Nushell script to install nu_plugin_*
|
2025-06-27 01:26:44 +01:00
|
|
|
│ ├── LICENSE
|
|
|
|
│ └── README.txt
|
|
|
|
├── generate Template to generate plugins. Used with make_plugin.sh
|
|
|
|
│ └── nu_plugin_template
|
|
|
|
├── LICENSE
|
|
|
|
├── make_plugin.sh To generate Nushell plugins. Used with generate path
|
|
|
|
├── nushell Nushell repo to be used as path for all nu_plugin_*
|
|
|
|
├── nu_plugin_clipboard
|
|
|
|
├── nu_plugin_desktop_notifications
|
|
|
|
├── nu_plugin_hashes
|
|
|
|
├── nu_plugin_highlight
|
|
|
|
├── nu_plugin_image
|
|
|
|
├── nu_plugin_port_extension
|
|
|
|
├── nu_plugin_qr_maker
|
|
|
|
├── nu_plugin_kcl Repo for nu_plugin_kcl (repo sub-module)
|
|
|
|
├── nu_plugin_tera Repo for nu_plugin_tera (repo sub-module)
|
|
|
|
├── api_nu_plugin_kcl A try to use API KCL, nu_plugin_kcl is recommended option
|
2025-06-27 05:08:46 +01:00
|
|
|
├── bin_archives Repo with plataform binaries as archives
|
2025-06-27 01:26:44 +01:00
|
|
|
└── README.md
|
|
|
|
</pre>
|
|
|
|
|
2025-06-27 03:36:46 +01:00
|
|
|
Main values can be changed in [env](env)
|
|
|
|
```bash
|
2025-06-27 05:08:46 +01:00
|
|
|
export APP_NAME=nushell-plugins
|
2025-06-27 03:36:46 +01:00
|
|
|
export TARGET_PATH=${TARGET_PATH:-distribution}
|
|
|
|
export INSTALL_FILE=${INSTALL_FILE:-install_nu_plugins.nu}
|
|
|
|
export INSTALL_BIN_PATH=${INSTALL_BIN_PATH:-/usr/local/bin}
|
2025-06-27 05:08:46 +01:00
|
|
|
export ARCHIVE_DIR_PATH=${ARCHIVE_DIR_PATH:-/tmp}
|
|
|
|
export BIN_ARCHIVES_DIR_PATH=bin_archives
|
2025-06-27 03:36:46 +01:00
|
|
|
```
|
|
|
|
|
2025-06-27 01:26:44 +01:00
|
|
|
## Build and Install
|
|
|
|
|
|
|
|
- Run [build-all.sh](build-all.sh)
|
|
|
|
```bash
|
|
|
|
./build-all.sh
|
|
|
|
```
|
|
|
|
- Collect all target/release with [collect-install.sh](collect-install.sh), this will:
|
2025-06-27 03:41:51 +01:00
|
|
|
- Run [distribution/collect-install.sh](distribution/collect-install.sh) to copy release binaries into [distribution](distribution) directory
|
2025-06-27 03:43:23 +01:00
|
|
|
- Install [distribution](distribution) directory **nu_plugin_** into $INSTALL_BIN_PATH (**/usr/local/bin**)
|
2025-06-27 03:41:51 +01:00
|
|
|
- Generatel [distribution](distribution) **nu_plugin_** install script in [install_nu_plugin.nu](distribution/install_nu_plugin.nu)
|
2025-06-27 07:54:20 +01:00
|
|
|
- Install [KCL](https://www.kcl-lang.io/) for **nu_plugin_kcl** into $INSTALL_BIN_PATH (**/usr/local/bin**)
|
2025-06-27 01:26:44 +01:00
|
|
|
```bash
|
|
|
|
./collect-install.sh
|
|
|
|
```
|
|
|
|
## Nushell install
|
|
|
|
|
|
|
|
Plugins have to be added from [Nushell](https://nushell.sh/)
|
|
|
|
|
2025-06-27 03:36:46 +01:00
|
|
|
Use [install_nu_plugin.nu](distribution/install_nu_plugin.nu)
|
|
|
|
```
|
|
|
|
distribution/install_nu_plugin.nu
|
2025-06-27 01:26:44 +01:00
|
|
|
```
|
|
|
|
|
2025-06-27 04:36:21 +01:00
|
|
|
## Pack distribution
|
2025-06-27 01:26:44 +01:00
|
|
|
|
2025-06-27 04:36:21 +01:00
|
|
|
[pack-dist.sh](pack-dist.sh) is script to archive **distribution** nu_plugin_* as architecture-platform.tar.gz
|
|
|
|
|
|
|
|
```bash
|
|
|
|
./pack-dis.sh
|
|
|
|
```
|
|
|
|
This will generate an architecture-platform.tar.gz like: darwin-arm64-nushell-plugins.tar.gz
|
|
|
|
|
|
|
|
To install in a plataform:
|
|
|
|
```bash
|
|
|
|
cd /tmp
|
|
|
|
tar xzf architecture-platform.tar.gz
|
|
|
|
cd distribution
|
|
|
|
./install.sh
|
|
|
|
./install_nu_plugin.nu
|
|
|
|
cd /tmp
|
|
|
|
```
|