From a5d485cf8a36f3f50b9fe4c3b58641eb364b8ed8 Mon Sep 17 00:00:00 2001 From: Jean-Yves LENHOF <36410287+jylenhof@users.noreply.github.com> Date: Tue, 30 Apr 2024 09:32:14 +0200 Subject: [PATCH] docs: add asdf and mise installation method (#6063) Signed-off-by: knqyf263 Co-authored-by: knqyf263 --- docs/getting-started/installation.md | 78 +++++++++++++++++++++------- 1 file changed, 59 insertions(+), 19 deletions(-) diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 47aa0f21b1ff..92daf75e36c4 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -85,31 +85,29 @@ References: Nix package manager for Linux and MacOS. === "Command line" - -`nix-env --install -A nixpkgs.trivy` + `nix-env --install -A nixpkgs.trivy` === "Configuration" - -```nix - # your other config ... - environment.systemPackages = with pkgs; [ - # your other packages ... - trivy - ]; -``` + ```nix + # your other config ... + environment.systemPackages = with pkgs; [ + # your other packages ... + trivy + ]; + ``` === "Home Manager" - -```nix - # your other config ... - home.packages = with pkgs; [ - # your other packages ... - trivy - ]; -``` + ```nix + # your other config ... + home.packages = with pkgs; [ + # your other packages ... + trivy + ]; + ``` References: -- + +- https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/admin/trivy/default.nix ### FreeBSD (Official) @@ -119,6 +117,48 @@ References: pkg install trivy ``` +### asdf/mise (Community) + +[asdf](https://github.com/asdf-vm/asdf) and [mise](https://github.com/jdx/mise) are quite similar tools you can use to install trivy. +See their respective documentation for more information of how to install them and use them: + +- [asdf](https://asdf-vm.com/guide/getting-started.html) +- [mise](https://mise.jdx.dev/getting-started.html) + +The plugin used by both tools is developped [here](https://github.com/zufardhiyaulhaq/asdf-trivy) + + +=== "asdf" + A basic global installation is shown below, for specific version or/and local version to a directory see "asdf" documentation. + + ```shell + # Install plugin + asdf plugin add trivy https://github.com/zufardhiyaulhaq/asdf-trivy.git + + # Install latest version + asdf install trivy latest + + # Set a version globally (on your ~/.tool-versions file) + asdf global trivy latest + + # Now trivy commands are available + trivy --version + ``` + +=== "mise" + A basic global installation is shown below, for specific version or/and local version to a directory see "mise" documentation. + + ``` shell + # Install plugin and install latest version + mise install trivy@latest + + # Set a version globally (on your ~/.tool-versions file) + mise use -g trivy@latest + + # Now trivy commands are available + trivy --version + ``` + ## Install from GitHub Release (Official) ### Download Binary