docs: add asdf and mise installation method (#6063)

Signed-off-by: knqyf263 <knqyf263@gmail.com>
Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
Jean-Yves LENHOF
2024-04-30 09:32:14 +02:00
committed by GitHub
parent 29b8faf5fa
commit a5d485cf8a

View File

@@ -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>
- 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