summary refs log tree commit diff
path: root/pkgs/applications/virtualization/open-vm-tools/recognize_nixos.patch
blob: 46d8ea7f7f3f6e1a28c78caea5b59f391ba6ab40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff --git a/lib/include/guest_os.h b/open-vm-tools/lib/include/guest_os.h
index ef202e3..c7a105d 100644
--- a/lib/include/guest_os.h
+++ b/lib/include/guest_os.h
@@ -238,6 +238,7 @@ Bool Gos_InSetArray(uint32 gos, const uint32 *set);
 #define STR_OS_MANDRAKE_FULL      "Mandrake Linux"
 #define STR_OS_MANDRIVA           "mandriva"
 #define STR_OS_MKLINUX            "MkLinux"
+#define STR_OS_NIXOS              "NixOS"
 #define STR_OS_NOVELL             "nld9"
 #define STR_OS_NOVELL_FULL        "Novell Linux Desktop 9"
 #define STR_OS_ORACLE6            "oraclelinux6"
diff --git a/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c
index 0f55070..2d8467c 100644
--- a/lib/misc/hostinfoPosix.c
+++ b/lib/misc/hostinfoPosix.c
@@ -195,6 +195,7 @@ static const DistroInfo distroArray[] = {
    {"Mandrake",           "/etc/mandrake-release"},
    {"Mandriva",           "/etc/mandriva-release"},
    {"MkLinux",            "/etc/mklinux-release"},
+   {"NixOS",              "/etc/os-release"},
    {"Novell",             "/etc/nld-release"},
    {"OracleLinux",        "/etc/oracle-release"},
    {"Photon",             "/etc/lsb-release"},
@@ -554,6 +555,8 @@ HostinfoGetOSShortName(char *distro,         // IN: full distro name
       }
    } else if (strstr(distroLower, "mandrake")) {
       Str_Strcpy(distroShort, STR_OS_MANDRAKE, distroShortSize);
+   } else if (strstr(distroLower, "nixos")) {
+      Str_Strcpy(distroShort, STR_OS_NIXOS, distroShortSize);
    } else if (strstr(distroLower, "turbolinux")) {
       Str_Strcpy(distroShort, STR_OS_TURBO, distroShortSize);
    } else if (strstr(distroLower, "sun")) {