From d20c0b9746648721a75b20e2aab29fb9e6411489 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 27 Feb 2023 10:49:40 -0500 Subject: [PATCH] Describe Diagnostics (#276) Co-authored-by: Cole Helbling --- README.md | 29 ++++++++++++++++++++++++++++- src/settings.rs | 10 ++++++---- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b3abfd8..686406e 100644 --- a/README.md +++ b/README.md @@ -293,4 +293,31 @@ nix build github:DeterminateSystems/nix-installer#nix-installer.doc firefox result-doc/nix-installer/index.html ``` -[systemd]: https://systemd.io \ No newline at end of file +## Diagnostics + +The goal of the Determinate Nix Installer is to successfully and correctly install Nix. +The `curl | sh` pipeline and the installer collects a little bit of diagnostic information to help us make that true. + +Here is a table of the [diagnostic data we collect][diagnosticdata]: + +| Field | Use | +| --------------------- | ----------------------------------------------------------------------------------------------------- | +| `version` | The version of the Determinate Nix Installer. | +| `planner` | The method of installing Nix (`linux`, `macos`, `steam-deck`) | +| `configured_settings` | The names of planner settings which were changed from their default. Does _not_ include the values. | +| `os_name` | The running operating system. | +| `os_version` | The version of the operating system. | +| `triple` | The architecture/operating system/binary format of your system. | +| `is_ci` | Whether the installer is being used in CI (e.g. GitHub Actions). | +| `action` | Either `Install` or `Uninstall`. | +| `status` | One of `Success`, `Failure`, `Pending`, or `Cancelled`. | +| `failure_variant` | A high level description of what the failure was, if any. For example: `Command` if a command failed. | + +To disable diagnostic reporting, set the diagnostics URL to an empty string by passing `--diagnostic-endpoint=""` or setting `NIX_INSTALLER_DIAGNOSTIC_ENDPOINT=""`. + +You can read the full privacy policy for [Determinate Systems][detsys], the creators of the Determinate Nix Installer, [here][privacy]. + +[detsys]: https://determinate.systems/ +[diagnosticdata]: https://github.com/DeterminateSystems/nix-installer/blob/f9f927840d532b71f41670382a30cfcbea2d8a35/src/diagnostics.rs#L29-L43 +[privacy]: https://determinate.systems/privacy +[systemd]: https://systemd.io diff --git a/src/settings.rs b/src/settings.rs index d92413e..f8f9b45 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -211,12 +211,14 @@ pub struct CommonSettings { /// { /// "version": "0.4.0", /// "planner": "linux", - /// "configured-settings": [ "modify_profile" ], - /// "os-name": "Ubuntu", - /// "os-version": "22.04.1 LTS (Jammy Jellyfish)", + /// "configured_settings": [ "modify_profile" ], + /// "os_name": "Ubuntu", + /// "os_version": "22.04.1 LTS (Jammy Jellyfish)", /// "triple": "x86_64-unknown-linux-gnu", + /// "is_ci": false, /// "action": "Install", - /// "status": "Success" + /// "status": "Failure", + /// "failure_variant": "Symlink" /// } /// /// To disable diagnostic reporting, unset the default with `--diagnostic-endpoint=`