feat: Add operating system module (#4109)

* docs(os): Add os module documentation

* docs(os): Add os to Default Prompt Format

* chore(os): Update config file schema

* feat(os): Add os entries and declarations

* feat(os): Add os module and config

* fix(os): Obey config.disabled

* feat(os): make variables 'Unknown'-aware

refactor(os): calculate variables in dedicated functions

* test(os): Add os module tests

* feat(os): make 'name' variable less 'Unknown'-aware

* docs(os): Add Preset configurations

docs(os): Use emoji as default

* feat(os): Use emoji as default

test(os): Use emoji as default

* fix(os): Add spaces after emoji symbols

* chore(os): Update config schema

* feat(os): Remove `bitness` variable

docs(os): Remove `bitness` variable

test(os): Remove `bitness` test

* feat(os): Add Cargo.toml upgrade caution for os_info

* refactor(os): Clarify get_symbol function

* docs(os): Mention supported operating systems and feature requests

* docs(os): Mention os_info inacurracy

* test(os): Remove `bitness` leftovers

* refactor(os): use nu_ansi_term

* refactor(os): add cfg_attr(schemars(deny_unknown_fields))

* chore(os): update config schema

* docs(os): expose details block

* feat(os): add garuda linux

* chore(os): update config schema

* feat(os): add case insensitivity

* feat(os): add symbols `IndexMap` use `os_info::Type` instead of `String`

* test(os): add clippy warn on new os_info::Type case

* leave missing case to test github tests

* test(os): re-add missing test case

* style(os): fix formatting

* docs(os): update to match os_info::Type serialization

- docs(os): add missing garuda to config

- test(os): mention docs updates in warn_on_os_info_update
This commit is contained in:
exincore
2022-11-06 14:37:58 -07:00
committed by GitHub
parent 0ba8533e2d
commit 3109943822
13 changed files with 769 additions and 1 deletions
+112
View File
@@ -1027,6 +1027,56 @@
}
]
},
"os": {
"default": {
"disabled": true,
"format": "[$symbol]($style)",
"style": "bold white",
"symbols": {
"Alpine": "🏔️ ",
"Amazon": "🙂 ",
"Android": "🤖 ",
"Arch": "🎗️ ",
"CentOS": "💠 ",
"Debian": "🌀 ",
"DragonFly": "🐉 ",
"Emscripten": "🔗 ",
"EndeavourOS": "🚀 ",
"Fedora": "🎩 ",
"FreeBSD": "😈 ",
"Garuda": "🦅 ",
"Gentoo": "🗜️ ",
"HardenedBSD": "🛡️ ",
"Illumos": "🐦 ",
"Linux": "🐧 ",
"Macos": "🍎 ",
"Manjaro": "🥭 ",
"Mariner": "🌊 ",
"MidnightBSD": "🌘 ",
"Mint": "🌿 ",
"NetBSD": "🚩 ",
"NixOS": "❄️ ",
"OpenBSD": "🐡 ",
"OracleLinux": "🦴 ",
"Pop": "🍭 ",
"Raspbian": "🍓 ",
"RedHatEnterprise": "🎩 ",
"Redhat": "🎩 ",
"Redox": "🧪 ",
"SUSE": "🦎 ",
"Solus": "⛵ ",
"Ubuntu": "🎯 ",
"Unknown": "❓ ",
"Windows": "🪟 ",
"openSUSE": "🦎 "
}
},
"allOf": [
{
"$ref": "#/definitions/OSConfig"
}
]
},
"package": {
"default": {
"disabled": false,
@@ -3989,6 +4039,68 @@
},
"additionalProperties": false
},
"OSConfig": {
"type": "object",
"properties": {
"format": {
"default": "[$symbol]($style)",
"type": "string"
},
"style": {
"default": "bold white",
"type": "string"
},
"symbols": {
"default": {
"Alpine": "🏔️ ",
"Amazon": "🙂 ",
"Android": "🤖 ",
"Arch": "🎗️ ",
"CentOS": "💠 ",
"Debian": "🌀 ",
"DragonFly": "🐉 ",
"Emscripten": "🔗 ",
"EndeavourOS": "🚀 ",
"Fedora": "🎩 ",
"FreeBSD": "😈 ",
"Garuda": "🦅 ",
"Gentoo": "🗜️ ",
"HardenedBSD": "🛡️ ",
"Illumos": "🐦 ",
"Linux": "🐧 ",
"Macos": "🍎 ",
"Manjaro": "🥭 ",
"Mariner": "🌊 ",
"MidnightBSD": "🌘 ",
"Mint": "🌿 ",
"NetBSD": "🚩 ",
"NixOS": "❄️ ",
"OpenBSD": "🐡 ",
"OracleLinux": "🦴 ",
"Pop": "🍭 ",
"Raspbian": "🍓 ",
"RedHatEnterprise": "🎩 ",
"Redhat": "🎩 ",
"Redox": "🧪 ",
"SUSE": "🦎 ",
"Solus": "⛵ ",
"Ubuntu": "🎯 ",
"Unknown": "❓ ",
"Windows": "🪟 ",
"openSUSE": "🦎 "
},
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"disabled": {
"default": true,
"type": "boolean"
}
},
"additionalProperties": false
},
"PackageConfig": {
"type": "object",
"properties": {