Skip to content

Commit

Permalink
docs: add asdf and mise installation method (aquasecurity#6063)
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <[email protected]>
Co-authored-by: knqyf263 <[email protected]>
  • Loading branch information
jylenhof and knqyf263 committed Apr 30, 2024
1 parent 29b8faf commit a5d485c
Showing 1 changed file with 59 additions and 19 deletions.
78 changes: 59 additions & 19 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit a5d485c

Please sign in to comment.