Home Explore Blog Models CI



nixpkgs

nixos/modules/services/monitoring/goss.md
ebbdddd143d2e7c909b25775232d6579598994c3c582c08400000003000003c3
# Goss {#module-services-goss}

[goss](https://goss.rocks/) is a YAML based serverspec alternative tool
for validating a server's configuration.

## Basic Usage {#module-services-goss-basic-usage}

A minimal configuration looks like this:

```nix
{
  services.goss = {
    enable = true;

    environment = {
      GOSS_FMT = "json";
      GOSS_LOGLEVEL = "TRACE";
    };

    settings = {
      addr."tcp://localhost:8080" = {
        reachable = true;
        local-address = "127.0.0.1";
      };
      command."check-goss-version" = {
        exec = "${lib.getExe pkgs.goss} --version";
        exit-status = 0;
      };
      dns.localhost.resolvable = true;
      file."/nix" = {
        filetype = "directory";
        exists = true;
      };
      group.root.exists = true;
      kernel-param."kernel.ostype".value = "Linux";
      service.goss = {
        enabled = true;
        running = true;
      };
      user.root.exists = true;
    };
  };
}
```

Chunks
07e3f5b8 (1st chunk of `nixos/modules/services/monitoring/goss.md`)
Title: Goss Service Configuration in Nix
Summary
This section introduces Goss, a YAML-based serverspec alternative for validating server configurations. It provides a basic usage example within a Nix configuration, demonstrating how to enable the Goss service, set environment variables like `GOSS_FMT` and `GOSS_LOGLEVEL`, and define various configuration checks. These checks include network address reachability, command execution and exit status, DNS resolution, file/directory existence and type, group and user existence, kernel parameters, and service running/enabled status.