Created
July 13, 2026 05:56
-
-
Save jordansissel/e4a56c60daef061be3eaf77f4c077079 to your computer and use it in GitHub Desktop.
map of struct, lookup table using os.release()->id as a key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $osinfo = os.release() | |
| # A rose by any other name... everybody likes to call packages by different names. | |
| # And why not? Why shouldn't we all use slightly different names to refer to exactly the same item. | |
| $rose struct { package struct { desktop map{str: str}; gdm str; ssh str }; service struct { ssh str }; paths struct { gdm_config str } } = { | |
| "fedora" => struct { | |
| package => struct { | |
| desktop => { | |
| "gnome" => "gnome-desktop4", | |
| "kde" => "plasma-desktop", | |
| "cosmic" => "cosmic-session", | |
| }, | |
| gdm => "gdm", | |
| ssh => "openssh-server", | |
| }, | |
| service => struct { | |
| ssh => "sshd", | |
| }, | |
| paths => struct { | |
| gdm_config => "/etc/gdm/custom.conf", | |
| }, | |
| }, | |
| "ubuntu" => struct { | |
| package => struct { | |
| desktop => { | |
| "gnome" => "ubuntu-gnome-desktop", | |
| "kde" => "kde-plasma-desktop", | |
| }, | |
| gdm => "gdm3", | |
| ssh => "openssh-server", | |
| }, | |
| service => struct { | |
| ssh => "ssh", | |
| }, | |
| paths => struct { | |
| gdm_config => "/etc/gdm3/custom.conf", | |
| }, | |
| }, | |
| "debian" => struct { | |
| package => struct { | |
| desktop => { | |
| "gnome" => "gnome", | |
| "kde" => "kde-plasma-desktop", | |
| }, | |
| gdm => "gdm3", | |
| ssh => "openssh-server", | |
| }, | |
| service => struct { | |
| ssh => "ssh", | |
| }, | |
| paths => struct { | |
| gdm_config => "/etc/gdm3/daemon.conf", | |
| }, | |
| }, | |
| "arch" => struct { | |
| package => struct { | |
| desktop => { | |
| "gnome" => "gnome-initial-setup", | |
| "kde" => "plasma-meta", | |
| "niri" => "niri", | |
| }, | |
| gdm => "gdm", | |
| ssh => "openssh", | |
| }, | |
| service => struct { | |
| ssh => "sshd", | |
| }, | |
| paths => struct { | |
| gdm_config => "/etc/gdm/custom.conf", | |
| }, | |
| }, | |
| }[$osinfo->id] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment