Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add asdf and mise installation method #6063

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 59 additions & 19 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,31 +86,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 @@ -120,6 +118,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