control/controlclient, version/distro: detect NixOS explicitly

The fallthrough happened to work in controlclient already due to the
/etc/os-release PRETTY_NAME default, but make it explicit so it
doesn't look like an accident.

Also add it to version/distro, even though nothing needs it yet.
This commit is contained in:
Brad Fitzpatrick
2020-12-21 20:57:35 -08:00
parent 2b2a16d9a2
commit ef15096a7d
3 changed files with 32 additions and 8 deletions

View File

@ -73,7 +73,7 @@ func osVersionLinux() string {
return fmt.Sprintf("%s%s", bytes.TrimSpace(cr), attr)
}
fallthrough
case "fedora", "rhel", "alpine":
case "fedora", "rhel", "alpine", "nixos":
// Their PRETTY_NAME is fine as-is for all versions I tested.
fallthrough
default: