Skip to content

Commit

Permalink
Merge pull request #85 from retrohacker/feature/basic-nixos-recognition
Browse files Browse the repository at this point in the history
Add basic NixOS recognition
  • Loading branch information
William Blankenship authored Nov 22, 2018
2 parents e4ec6f1 + 89012fb commit 8173d24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 1 addition & 0 deletions os.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"/etc/debian_version" : ["Debian"],
"/etc/debian_release" : ["Debian"],
"/etc/os-release": ["Raspbian"],
"/etc/NIXOS": ["NixOS"],
"/etc/annvix-release" : ["Annvix"],
"/etc/arch-release" : ["Arch Linux"],
"/etc/arklinux-release" : ["Arklinux"],
Expand Down
10 changes: 1 addition & 9 deletions tests/mockdata.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
[

{ "desc": "OS X", "platform": "darwin", "expected": { "os": "darwin" } }

, { "desc": "Windows", "platform": "win32", "expected": { "os": "win32" } }

, { "desc": "Ubuntu 14.10", "platform": "linux", "file": { "/etc/lsb-release": "DISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=14.10\nDISTRIB_CODENAME=utopic\nDISTRIB_DESCRIPTION=\"Ubuntu 14.10\"\n" }, "expected": { "codename": "utopic", "dist": "Ubuntu Linux", "os": "linux", "release": "14.10" } }
, { "desc": "Ubuntu 14.04", "platform": "linux", "file": { "/etc/lsb-release": "DISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=14.04\nDISTRIB_CODENAME=trusty\nDISTRIB_DESCRIPTION=\"Ubuntu 14.04.2 LTS\"\n" }, "expected": { "codename": "trusty", "dist": "Ubuntu Linux", "os": "linux", "release": "14.04" } }
, { "desc": "Ubuntu 12.04", "platform": "linux", "file": { "/etc/lsb-release": "DISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=12.04\nDISTRIB_CODENAME=precise\nDISTRIB_DESCRIPTION=\"Ubuntu 12.04.5 LTS\"\n" }, "expected": { "codename": "precise", "dist": "Ubuntu Linux", "os": "linux", "release": "12.04" } }

, { "desc": "Fedora 21", "platform": "linux", "file": { "/etc/fedora-release": "Fedora release 21 (Twenty One)\n" }, "expected": { "codename": "Twenty One", "dist": "Fedora", "os": "linux", "release": "21" } }

, { "desc": "CentOS 5.11", "platform": "linux", "file": { "/etc/redhat-release": "CentOS release 5.11 (Final)\n" }, "expected": { "codename": "final", "dist": "Centos", "os": "linux", "release": "5.11" } }
, { "desc": "Centos 6.6", "platform": "linux", "file": { "/etc/redhat-release": "CentOS release 6.6 (Final)\n" }, "expected": { "codename": "final", "dist": "Centos", "os": "linux", "release": "6.6" } }
, { "desc": "Centos 7.1", "platform": "linux", "file": { "/etc/redhat-release": "CentOS Linux release 7.1.1503 (Core)\n" }, "expected": { "codename": "core", "dist": "Centos", "os": "linux", "release": "7.1.1503" } }

, { "desc": "RHEL 6.5", "platform": "linux", "file": { "/etc/redhat-release": "Red Hat Enterprise Linux Server release 6.5 (Santiago)\n" }, "expected": { "codename": "santiago", "dist": "Red Hat Linux", "os": "linux", "release": "6.5" } }
, { "desc": "RHEL 6.6", "platform": "linux", "file": { "/etc/redhat-release": "Red Hat Enterprise Linux Server release 6.6 (Santiago)\n" }, "expected": { "codename": "santiago", "dist": "Red Hat Linux", "os": "linux", "release": "6.6" } }
, { "desc": "RHEL 7.0", "platform": "linux", "file": { "/etc/redhat-release": "Red Hat Enterprise Linux Server release 7.0 (Maipo)\n" }, "expected": { "codename": "maipo", "dist": "Red Hat Linux", "os": "linux", "release": "7.0" } }

, { "desc": "SUSE Linux", "platform": "linux", "file": { "/etc/SuSE-release": "SUSE Linux Enterprise Server 11 (x86_64)\nVERSION = 11\nPATCHLEVEL = 4\n" }, "expected": { "dist": "SUSE Linux", "os": "linux", "release": "11" } }
, { "desc": "Alpine Linux", "platform": "linux", "file": { "/etc/alpine-release": "3.3\n" }, "expected": { "dist": "Alpine Linux", "os": "linux", "release": "3.3" } }
, { "desc": "Amazon Linux", "platform": "linux", "file": { "/etc/system-release": "Amazon Linux AMI release 2016.03"}, "expected": {"dist": "Amazon Linux", "os": "linux", "release": "2016.03"}}
, { "desc": "Arch Linux", "platform": "linux", "file": { "/etc/lsb-release": "LSB_VERSION=1.4\nDISTRIB_ID=Arch\nDISTRIB_RELEASE=rolling\nDISTRIB_DESCRIPTION=\"Arch Linux\""}, "expected": {"dist": "Arch Linux", "os": "linux", "release": "rolling"}}
, { "desc": "Linux Mint", "platform": "linux", "file": { "/etc/lsb-release": "DISTRIB_ID=LinuxMint\nDISTRIB_RELEASE=18\nDISTRIB_CODENAME=sarah\nDISTRIB_DESCRIPTION=\"Linux Mint 18 Sarah\""}, "expected": {"dist": "Linux Mint", "os": "linux", "codename": "sarah", "release": "18"}}

, { "desc": "Raspbian 8", "platform": "linux", "file": { "/etc/os-release": "PRETTY_NAME=\"Raspbian GNU/Linux 8 (jessie)\"\nNAME=\"Raspbian GNU/Linux\"\nVERSION_ID=\"8\"\nVERSION=\"8 (jessie)\"\nID=raspbian\nHOME_URL=\"http://www.raspbian.org/\"\nSUPPORT_URL=\"http://www.raspbian.org/RaspbianForums\"\nBUG_REPORT_URL=\"http://www.raspbian.org/RaspbianBugs\"" }, "expected": { "codename": "jessie", "dist": "Raspbian", "os": "linux", "release": "8" } }

, { "desc": "Manjaro Linux", "platform": "linux", "file": { "/etc/lsb-release": "DISTRIB_ID=ManjaroLinux\nDISTRIB_RELEASE=17.1.10\nDISTRIB_CODENAME=Hakoila\nDISTRIB_DESCRIPTION=\"Manjaro Linux\"" }, "expected": { "codename": "hakoila", "dist": "Manjaro Linux", "os": "linux", "release": "17.1.10" } }
, { "desc": "NixOS", "platform": "linux", "file": { "/etc/NIXOS": " " }, "expected": { "dist": "NixOS", "os": "linux" } }
]

0 comments on commit 8173d24

Please sign in to comment.