Skip to content

Commit

Permalink
doc: nixos.md: Corrected to showcase module usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpds committed May 1, 2024
1 parent 61b0b36 commit f55fdcb
Showing 1 changed file with 35 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,50 @@ weight: 6
[NixOS] is a Linux distribution built on top of the Nix package manager. This
page covers installing and managing Vector on NixOS.

Nixpkgs has a [community maintained package][nixpkg-vector] for Vector. It can
be installed on a NixOS system with the following snippet in
`configuration.nix`:
Nixpkgs has a [community maintained module][nixpkg-vector] for Vector.
The options for which may be viewed on the [NixOS Search][nixos-search].

This can be used to deploy and configure Vector on a NixOS system.
For example, place into a system's `configuration.nix`:

```nix
environment.systemPackages = [
pkgs.vector
];
services.vector = {
enable = true;
journaldAccess = true;
settings = builtins.fromTOML ''
[sources.journald]
type = "journald"
current_boot_only = true
[sources.vector_metrics]
type = "internal_metrics"
[sinks.loki]
type = "loki"
inputs = [ "journald" ]
endpoint = "https://loki.mycompany.com"
[sinks.loki.labels]
source = "journald"
[sinks.prometheus_exporter]
type = "prometheus_exporter"
inputs = [ "vector_metrics" ]
address = "[::]:9598"
'';
};
```

The module will allow validate that the Vector configuration is valid before
enabling any changes.

See also the [Nix] package page.

## Supported installers

{{< supported-installers >}}

[nixos]: https://www.nixos.org
[nixpkg-vector]: https://github.com/NixOS/nixpkgs/tree/master/pkgs/tools/misc/vector
[nixpkg-vector]: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/logging/vector.nix
[nixos-search]: https://search.nixos.org/options?query=services.vector
[nix]: /docs/setup/installation/package-managers/nix

0 comments on commit f55fdcb

Please sign in to comment.