From 0bb08ee75b5fec6c4355d0f9b66ddab8d4d4d1b4 Mon Sep 17 00:00:00 2001 From: JesseBot Date: Thu, 17 Nov 2022 11:45:33 +0100 Subject: [PATCH] Move global brewfile to packages yml (#84) * fix duplicate help text Choices * moving away from brewfiles and adding a font step for macOS * ticking up version and removing poetry from brew, since it's in pip3.11 * fix up docs a bit, and add checking for local packages.yml for user * fix more 'media' to be 'gui' and update help and docs * fixed headings to show font installation on mac again * fix typos in help text --- docs/onboardme/getting-started.md | 122 ++-------- docs/onboardme/onboardme.md | 68 +++--- docs/onboardme/screenshots/help_text.svg | 284 +++++++++++------------ onboardme/__init__.py | 2 +- onboardme/config/brew/Brewfile_Darwin | 80 ------- onboardme/config/brew/Brewfile_devops | 33 --- onboardme/config/onboardme_config.yml | 1 + onboardme/config/packages.yml | 177 ++++++++++++-- onboardme/env_config.py | 2 +- onboardme/help_text.py | 6 +- onboardme/ide_setup.py | 27 ++- onboardme/pkg_management.py | 85 ++----- pyproject.toml | 2 +- 13 files changed, 386 insertions(+), 503 deletions(-) delete mode 100644 onboardme/config/brew/Brewfile_Darwin delete mode 100644 onboardme/config/brew/Brewfile_devops diff --git a/docs/onboardme/getting-started.md b/docs/onboardme/getting-started.md index 34680717..09655a6b 100644 --- a/docs/onboardme/getting-started.md +++ b/docs/onboardme/getting-started.md @@ -68,6 +68,7 @@ Those defaults can be altered per machine by creating a config file like: Darwin: - dot_files - packages + - font_setup - vim_setup - neovim_setup # these are linux specific steps @@ -128,110 +129,10 @@ Those defaults can be altered per machine by creating a config file like: -We also use a few package files, namely `packages.yml` and a couple of Brewfiles. - -
- `~/.config/onboardme/packages.yml` - - ```yaml - --- - apt: - emoji: "šŸ™ƒ" - commands: - list: "apt list --installed" - install: "sudo apt-get install -y " - update: "sudo apt-get update -y" - upgrade: "sudo apt-get upgrade -y" - packages: - default: - - terminator - - openssl - - sysstat - - silversearcher-ag - # this should let you use the a yubikey for auth - - libpam-yubico - - finger - - ssh - # - nextcloud-desktop - - screen - - youtube-dl - - bash-completion - # networking - - iptables - - gufw - - net-tools - # package managers installing package managers... this is terrible. - - snapd - - flatpak - - gnome-software-plugin-flatpak - # cat images in the terminal :) works in tmux - - catimg - # this lets you ls images as thumbnails, which is helpful sometimes - - imagemagick - # pretty syntaxhighlighted cat files with git diff support - - batcat - # print a very pretty pallete to see all the colors the terminal can render - - colortest - gaming: - - lutris - - winehq-staging - - steam - # to format disks to exFAT; FAT is too thin for modern windows 10 ISOs - # - exfat-utils - - flatpak: - emoji: "šŸ«“ " - commands: - setup: "sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo" - list: "flatpak list --columns=application" - install: "sudo flatpak install -y flathub " - packages: - default: - - "org.freedesktop.Platform/x86_64/21.08" - # youtube alternative - - io.freetubeapp.FreeTube - # password manager - - com.bitwarden.desktop - - snap: - emoji: "šŸ«° " - commands: - list: "snap list" - install: "sudo snap install " - packages: - default: - - core - # rss feed reader - - fluent-reader - # screen debugger/sharing tool for android - - scrcpy - - # most of this is actually for powerline, my shell prompt - pip3.11: - emoji: "šŸ" - commands: - list: "pip3.11 list" - install: "pip3.11 install --upgrade " - packages: - default: - # this is for python development - - pip - - build - - twine - - autoimport - # this is all powerline - - powerline-status - - powerline-gitstatus - - powerline-kubernetes - # for the internal ip address powerline shell prompt - - netifaces - # supposed to work with powerline for spotify info - - dbus - # this does some magic with imports when developing - ``` - -
- +We also use a package file called +[`packages.yml`](https://github.com/jessebot/onboardme/blob/main/onboardme/config/packages.yml) +which you can also place in your `~/.config/onboardme` directory, to take +precedence over our defaults. ## Config Sections and Explanations ### Steps @@ -241,6 +142,9 @@ configured for both macOS and Linux seperately. These steps include: - setting up dot files in your home directory (.bashrc, .vimrc, etc) - setting up vim (installing vim-plug and vim plugins) - managing packages using package managers (brew, pip3.11, apt, snap, flatpak) +- installing fonts +- setting up basic TUI IDEs, vim/neovim +- setting up groups They can be configured via the `steps` parameter in the `config.yml` above, or via the the cli like: @@ -301,15 +205,15 @@ For Linux, we also include: `apt`, `snap`, and `flatpak` See the examples below: -#### Install the "default" and "media" package groups +#### Install the "default" and "gui" package groups This would install the default packages for the basic cli experience and a -slim ide PLUS tools for media, like vlc. +slim ide PLUS GUI tools, like vlc and freetube. ##### `onboardme` cli ```bash -# can also be: onboardme -g default -g media -onboardme --pkg_groups default --pkg_groups media +# can also be: onboardme -g default -g gui +onboardme --pkg_groups default --pkg_groups gui ``` ##### `config.yml` @@ -318,7 +222,7 @@ onboardme --pkg_groups default --pkg_groups media package: groups: - default - - media + - gui ``` #### _Only_ install the "devops" package group for _only_ the `brew` package manager diff --git a/docs/onboardme/onboardme.md b/docs/onboardme/onboardme.md index bd106c84..c34fb489 100644 --- a/docs/onboardme/onboardme.md +++ b/docs/onboardme/onboardme.md @@ -13,45 +13,39 @@ This is [a project](https://github.com/jessebot/onboardme) to store config files screenshot of terminal after running onboardme. includes colortest-256, powerline prompt, icons for files in ls output, and syntax highlighting examples with cat command. -Looking for a project to get a fresh OS entirely, on a machine that has no OS? Check out [pxeless](https://github.com/cloudymax/pxeless). - ## Under the hood -šŸš§ Under construction šŸš§ - -| Step | Config Location in repo | OS | -|:----------------------------------------------|:--------------------------------------------------|:------------:| -| Git fetch dot files | n/a: fetched from a configured git repo | macOS/Debian | -| Installs cross-OS brew packages | n/a: installs `.Brewfile` from configured git repo| macOS/Debian | -| Installs brew packages | `./onboardme/config/brew/Brewfile_{OS}` | macOS/Debian | -| Installs pip3.11, apt, snap, flatpak packages | `./onboardme/config/packages.yml` | Debian | -| (OPTIONAL) Installs gaming related packages. | `./onboardme/config/packages.yml` | Debian | -| Installs fonts | n/a | macOS/Debian | -| Installs vim-plug + vim plugins | n/a: plugins fetched from a configured git repo | macOS/Debian | -| Installs packer.nvm + neovim plugins | n/a: plugins fetched from a configured git repo | macOS/Debian | -| Configures iptables (see note) | `./onbaordme/config` | Debian | -| Adds user to the docker group | n/a | Debian | - -*iptables note: to block traffic on most ports except for HTTPS as well as ICMP/SSH for a single IP* + +| Step | Config Location in repo | OS | +|--------------------------------------|------------------------------------------|---------------| +| Git fetch dot files | n/a: fetched from a configured git repo | macOS/Debian | +| Installs apps using package managers | `./onboardme/config/packages.yml` | Debian, macOS | +| Installs OPTIONAL apps | `./onboardme/config/packages.yml` | Debian | +| Installs fonts | n/a | macOS/Debian | +| Installs vim-plug + vim plugins | plugins fetched from configured git repo | macOS/Debian | +| Installs packer.nvm + neovim plugins | plugins fetched from configured git repo | macOS/Debian | +| Adds user to the docker group | n/a | Debian | + ### Current Ecoscape of Personal Tech -These are all Linux Desktop and macOS applications I use. -OnBoardMe doesn't officially support phones yet, but for what I use on my phone, check out my [doc](/onboardme/os/android). - -| Category | App | Replaces | -|:-----------------------|:------------------------------------|:----------------------------------| -| Backups - local/remote | Restic to minio and b2 | GDrive, iCloud, S3 | -| Web Browser | Firefox, w3m (terminal only) | Chrome/Safari/Edge | -| Email Client | Thunderbird + Protonmail + Bridge for Linux/MacOS | Gmail | -| IDE | Vim + Plugins, NeoVim + Plugins | Vscode/Pycharm etc | -| Document Editor | LibreOffice | Microsoft Word, Google Docs | -| Launcher | Undecided | Alfred | -| Photo/file Storage | NextCloud Files/Photos (testing) | Google Photos/Drive | -| Passwords | Bitwarden | LastPass, Apple/Google | -| News - RSS | Fluent Reader | Facebook/Twitter/news/brand feeds | -| Video | FreeTube, Peertube | YouTube | -| Antivirus | ClamAV | MalwareBytes | -| Firewall | Lulu/iptables | ??? | +These are all Linux Desktop and macOS applications we use. +OnBoardMe doesn't officially support phones yet, but for what I, Jesse, +use on my phone, check out my [doc](/onboardme/os/android). + +| Category | App | Replaces | +|:-----------------------|:---------------------------------|:----------------------------------| +| Backups - local/remote | Restic to minio and b2 | GDrive, iCloud, S3 | +| Web Browser | Firefox, w3m (terminal only) | Chrome/Safari/Edge | +| Email Client | Thunderbird, Protonmail + Bridge | Gmail | +| IDE | Vim/NeoVim + Plugins | Vscode/Pycharm etc | +| Document Editor | LibreOffice | Microsoft Word, Google Docs | +| Launcher | Cerebro | Alfred | +| Photo/file Storage | NextCloud Files/Photos (testing) | Google Photos/Drive | +| Passwords | Bitwarden | LastPass, Apple/Google | +| News - RSS | Fluent Reader | Facebook/Twitter/news/brand feeds | +| Video | FreeTube | YouTube | +| Antivirus | ClamAV | MalwareBytes | +| Firewall | Lulu/iptables | ??? | ## Important Notes on Ethics @@ -72,3 +66,7 @@ That same RFC also references a few tools you can use to fix your current enviro ### Tips Contact your local datacenters and see if they offer an object storage service, because they might, and it could be really cheap. Don't give your money to AWS, Microsoft, or Google if you don't absolutely have to. + +Looking for a project to get a fresh OS entirely, on a machine that has no OS? +Check out [pxeless](https://github.com/cloudymax/pxeless). +It works great in combination with onboardme :) diff --git a/docs/onboardme/screenshots/help_text.svg b/docs/onboardme/screenshots/help_text.svg index 56715c5a..32226889 100644 --- a/docs/onboardme/screenshots/help_text.svg +++ b/docs/onboardme/screenshots/help_text.svg @@ -1,4 +1,4 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - + + - Rich + term - - - - -                                         ā˜ļø  OnBoardMe šŸ’» -Get your daily driver just the way you like it, from textformatting, and dot files to -opensource package installation, onboardme intends to save you time with initializing or -upgrading your environment. - -Usage:  onboardme[OPTIONS] - -ā•­ā”€ āŒ„  Options ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā•® -ā”‚ā”‚ -ā”‚-l--log_level LOGLEVELLogging level. Choices: DEBUGINFOWARNERROR Default:   ā”‚ -ā”‚WARN.                                                       ā”‚ -ā”‚ā”‚ -ā”‚-o--log_file LOGFILEFull path to file to log to, if set.                        ā”‚ -ā”‚ā”‚ -ā”‚-s--steps STEPOnly run STEP in the script.                                ā”‚ -ā”‚Choices: dot_filespackagesvim_setupneovim_setupā”‚ -ā”‚Example: -sdot_files-spackagesā”‚ -ā”‚ā”‚ -ā”‚-u--git_url URLA git repo URL for your dot files. Default:                 ā”‚ -ā”‚https://github.com/jessebot/dot_filesā”‚ -ā”‚ā”‚ -ā”‚-b--git_branch BRANCHBranch to use for the git repo url. Default: main           ā”‚ -ā”‚ā”‚ -ā”‚-O--overwriteOverwrites existing dot files with files from configured    ā”‚ -ā”‚--git_url repo.                                             ā”‚ -ā”‚ā”‚ -ā”‚-p--pkg_managers PKG_MANAGERSpecific PKG_MANAGER to run. Choices: Choices: brewpip3.11ā”‚ -ā”‚Example: -pbrew-ppip3.11ā”‚ -ā”‚ā”‚ -ā”‚-g--pkg_groups PKG_GROUPPackage groups to install. Choices: Choices: devopsmediaā”‚ -ā”‚gamingā”‚ -ā”‚Example: -gdevops-ggamingā”‚ -ā”‚ā”‚ -ā”‚-f--firewallSetup iptables (on linux only).                             ā”‚ -ā”‚ā”‚ -ā”‚-r--remote_host IP_ADDRSetup SSH on a random port & add IP_ADDR to firewall        ā”‚ -ā”‚ā”‚ -ā”‚--versionPrint the version of onboardme.                             ā”‚ -ā”‚ā”‚ -ā”‚--helpShow this message and exit.                                 ā”‚ -ā•°ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€  ā™„ docs: jessebot.github.io/onboardmeā”€ā•Æ + + + + +                                                               ā˜ļø  OnBoardMe šŸ’» +Get your daily driver just the way you like it, from textformatting, and dot files to opensource package installation, onboardme intends +to save you time with initializing or upgrading your environment. + +Usage:  onboardme[OPTIONS] + +ā•­ā”€ āŒ„  Options ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā•® +ā”‚ā”‚ +ā”‚-l--log_level LOGLEVELLogging level. Choices: DEBUGINFOWARNERROR Default: WARN.                  ā”‚ +ā”‚ā”‚ +ā”‚-o--log_file LOGFILEFull path to file to log to, if set.                                             ā”‚ +ā”‚ā”‚ +ā”‚-s--steps STEPOnly run STEP in the script.                                                     ā”‚ +ā”‚Choices: dot_filespackagesfont_setupvim_setupneovim_setupā”‚ +ā”‚Example: -sdot_files-spackagesā”‚ +ā”‚ā”‚ +ā”‚-u--git_url URLA git repo URL for your dot files. Default: https://github.com/jessebot/dot_filesā”‚ +ā”‚ā”‚ +ā”‚-b--git_branch BRANCHBranch to use for the git repo url. Default: main                                ā”‚ +ā”‚ā”‚ +ā”‚-O--overwriteOverwrites existing dot files with files from configured --git_url repo.         ā”‚ +ā”‚ā”‚ +ā”‚-p--pkg_managers PKG_MANAGERSpecific PKG_MANAGER to run. Choices: brewpip3.11ā”‚ +ā”‚Example: -pbrew-ppip3.11ā”‚ +ā”‚ā”‚ +ā”‚-g--pkg_groups PKG_GROUPPackage groups to install. Choices: defaultdevopsguigamingā”‚ +ā”‚Example: -gdevops-ggamingā”‚ +ā”‚ā”‚ +ā”‚-f--firewallSetup iptables (on linux only).                                                  ā”‚ +ā”‚ā”‚ +ā”‚-r--remote_host IP_ADDRSetup SSH on a random port & add IP_ADDR to firewall                             ā”‚ +ā”‚ā”‚ +ā”‚--versionPrint the version of onboardme.                                                  ā”‚ +ā”‚ā”‚ +ā”‚--helpShow this message and exit.                                                      ā”‚ +ā•°ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€  ā™„ docs: jessebot.github.io/onboardmeā”€ā•Æ diff --git a/onboardme/__init__.py b/onboardme/__init__.py index 1bbd7c74..bb7bb92a 100755 --- a/onboardme/__init__.py +++ b/onboardme/__init__.py @@ -77,7 +77,7 @@ def setup_logger(level="", log_file=""): type=Choice(OPTS['package']['managers'][OS[0]]), help=HELP['pkg_managers']) @option('--pkg_groups', '-g', metavar='PKG_GROUP', multiple=True, - type=Choice(['default', 'gaming', 'media', 'devops']), + type=Choice(['default', 'gaming', 'gui', 'devops']), help=HELP['pkg_groups']) @option('--firewall', '-f', is_flag=True, help=HELP['firewall']) @option('--remote_host', '-r', metavar="IP_ADDR", multiple=True, diff --git a/onboardme/config/brew/Brewfile_Darwin b/onboardme/config/brew/Brewfile_Darwin deleted file mode 100644 index 5fe3dec3..00000000 --- a/onboardme/config/brew/Brewfile_Darwin +++ /dev/null @@ -1,80 +0,0 @@ -# This file is macOS specific. Won't work with LinuxBrew # -########################################################### -# ===-----------------------------------------------=== # -# General # -# ===-----------------------------------------------=== # -########################################################### - -# this lets us resize windows -cask "rectangle" -# productivity search and command bar -cask "alfred" -# Default browser -cask "firefox" -# Default email client -cask "thunderbird" -# File server -cask "nextcloud" - -########################################################### -# ===-----------------------------------------------=== # -# Making the terminal better # -# ===-----------------------------------------------=== # -########################################################### - -# Default terminal used by most macOS users, standard -cask "iterm2" -# backup terminal written in javascript :shrug: -cask "hyper" - -# gives us the default gnu/linux sed we all know and love -brew "gnu-sed" -# current version of bash :) -brew "bash" -# so that bash completion stuff works -brew "bash-completion@2" - -# tap special cask for various terminal fonts -tap "homebrew/cask-fonts" -cask "font-mononoki" -cask "font-symbols-only-nerd-font" -# cat images in the terminal (e.g. img2sixel imagename.png) -brew "libsixel" -# for working with images and making lsimg work -brew "imagemagick" - -# remap keys... not working yet though :< -# cask "karabiner-elements" - -########################################################### -# ===-----------------------------------------------=== # -# Mac specific DevOpsing # -# ===-----------------------------------------------=== # -########################################################### - -# This should be docker desktop -cask "docker" - -########################################################### -# ===-----------------------------------------------=== # -# Media and Entertainment # -# ===-----------------------------------------------=== # -########################################################### - -# primary media player -cask "vlc" -# youtube replacement -cask "freetube" - -########################################################### -# ===-----------------------------------------------=== # -# Security # -# ===-----------------------------------------------=== # -########################################################### - -# firewall -cask "lulu" -# password manager -cask "bitwarden" -# VPN -cask "protonvpn" diff --git a/onboardme/config/brew/Brewfile_devops b/onboardme/config/brew/Brewfile_devops deleted file mode 100644 index 483068d3..00000000 --- a/onboardme/config/brew/Brewfile_devops +++ /dev/null @@ -1,33 +0,0 @@ -# aws work stuff -# brew "aws-cli" -# aws credentials switcher -# cask "aws-vault" - -# terraform for building stuff -brew "terraform" -# this lets you manage multiple versions of terraform -# brew "tfenv" - -# cli for k8s (kubernetes) -brew "kubectl" - -# kubectl plugin manager -brew "krew" - -# terminal based dashbaord for k8s -brew "k9s" - -# package manager for k8s -brew "helm" - -# manages helm files -# brew "helmfile" - -# cli for Bitnami sealed-secrets, encrypting secrets in yaml files for gitops -brew "kubeseal" - -# gitops continuous delivery for k8s configs -brew "argocd" - -# KinD (Kubernetes in Docker), for small k8s clusters for testing -brew "kind" diff --git a/onboardme/config/onboardme_config.yml b/onboardme/config/onboardme_config.yml index 47a1bcb6..aededb59 100644 --- a/onboardme/config/onboardme_config.yml +++ b/onboardme/config/onboardme_config.yml @@ -26,6 +26,7 @@ steps: Darwin: - dot_files - packages + - font_setup - vim_setup - neovim_setup # these are linux specific steps diff --git a/onboardme/config/packages.yml b/onboardme/config/packages.yml index 8b857fc7..9f0a15e2 100644 --- a/onboardme/config/packages.yml +++ b/onboardme/config/packages.yml @@ -1,4 +1,153 @@ --- +brew: + emoji: "šŸŗ" + commands: + list: "brew list -1" + update: "brew update --quiet" + upgrade: "brew upgrade --quiet" + install: "brew install " + cleanup: "brew cleanup" + packages: + # these are all for both macOS and Debian + default: + # for testing apis and downloading things + - curl + - wget + # terminal based web browser + - lynx + # screen session + sharing/splitting + - tmux + # recording a shell session to share with others + - asciinema + # main terminal based text editors + - vim + - neovim + # fuzzy search, helps with completion and searching + - fzf + # ls replacement written in rust: https://github.com/Peltoche/lsd + - lsd + # A cat(1) clone with syntax highlighting and Git integration. + - bat + # pretty formatting and syntax highlighting + - rich + # file TUI: https://www.geeksforgeeks.org/ranger-a-cli-file-manager/ + - ranger + # preview videos in the terminal + - ffmpegthumbnailer + # like grep or ack, but more modern, for searching file text + - ag + # diff, but with colors + - colordiff + - htop + - gotop + - neofetch + # prettier du/df outputs: https://github.com/muesli/duf + - duf + # rainbow text + - lolcat + # blocky fonts: https://devhints.io/figlet + - figlet + - toilet + # steam locamotive + - sl + # a cow that says things + - cowsay + # revision control system + - git + # github cli + - gh + # gitlab cli + - glab + # making things + - cmake + # programming languages and their package managers + - python@3.11 + - go + - npm + # linter for YAML + - yamllint + # linter for html5 + - tidy-html5 + # mardown rendering + - pandoc + # for parsing json via cli + - jq + # search stackoverflow e.g. howdoi extend a dictionary in python + - howdoi + # get the quick, short text of how to use various commands + - tldr + # generating SSL certs and random strings + - openssl + # password management + - bitwarden-cli + # anti virus + - clamav + # macOS specific stuff. Won't work with LinuxBrew + macOS: + # current version of bash :) + - bash + # so that bash completion stuff works + - "bash-completion@2" + # this lets us resize windows + - "--cask rectangle" + # productivity search and command bar + - "--cask alfred" + # Default browser + - "--cask firefox" + # Default email client + - "--cask thunderbird" + # File server + - "--cask nextcloud" + # Default terminal used by most macOS users, standard + - "--cask iterm2" + # backup terminal written in javascript :shrug: + - "--cask hyper" + # gives us the default gnu/linux sed we all know and love + - "gnu-sed" + # cat images in the terminal (e.g. img2sixel imagename.png) + - libsixel + # for working with images and making lsimg work + - imagemagick + # remap keys... not working yet though :< + # - "--cask karabiner-elements" + # This should be docker desktop + - "--cask docker" + # primary media player + - "--cask vlc" + # youtube replacement + - "--cask freetube" + # firewall + - "--cask lulu" + # password manager + - "--cask bitwarden" + # VPN + - "--cask protonvpn" + devops: + # terraform for building stuff + - terraform + # manage multiple versions of terraform + # - tfenv + # cli for k8s (kubernetes) + - kubectl + # kubectl plugin manager + - krew + # terminal based dashbaord for k8s + - k9s + # package manager for k8s + - helm + # manages helm files + # - helmfile + # cli for Bitnami sealed-secrets, encrypting secrets in yaml files for gitops + - kubeseal + # gitops continuous delivery for k8s configs + - argocd + # KinD (Kubernetes in Docker), for small k8s clusters for testing + - kind + # aws work stuff + # "aws-cli" + # aws credentials switcher + # "--cask aws-vault" + apt: emoji: "šŸ™ƒ" commands: @@ -9,32 +158,35 @@ apt: cleanup: "sudo apt-get autoremove -y" packages: default: + # terminal emulator for linux - terminator - - openssl + # troubleshooting - sysstat + # better grep alternative - silversearcher-ag # this should let you use the a yubikey for auth - libpam-yubico - - finger - - ssh + # commented out till nextcloud is working # - nextcloud-desktop - - screen - youtube-dl - bash-completion - # networking + # networking and firewall - iptables - - gufw - net-tools # package managers installing package managers... this is terrible. - snapd - flatpak - - gnome-software-plugin-flatpak # cat images in the terminal :) works in tmux - catimg # this lets you ls images as thumbnails, which is helpful sometimes - imagemagick - # print a very pretty pallete to see all colors the terminal can render + # print a pretty pallete to see all colors the terminal can render - colortest + gui: + # this lets you install flatpak packages via the gui + - gnome-software-plugin-flatpak + # gui firewall + - gufw gaming: # helpful for gaming on linux - lutris @@ -50,11 +202,10 @@ flatpak: list: "flatpak list --user --columns=application" install: "flatpak install --user --app -y " packages: - default: + gui: - "org.freedesktop.Platform/x86_64/21.08" # password manager - com.bitwarden.desktop - media: # youtube alternative - io.freetubeapp.FreeTube @@ -67,11 +218,11 @@ snap: packages: default: - core - # rss feed reader - - fluent-reader # screen debugger/sharing tool for android - scrcpy - media: + gui: + # rss feed reader + - fluent-reader # media player - vlc diff --git a/onboardme/env_config.py b/onboardme/env_config.py index b71becb9..609aa3c8 100755 --- a/onboardme/env_config.py +++ b/onboardme/env_config.py @@ -41,7 +41,7 @@ def get_version(): """ # this is hardcoded because we're about upgrade major versions & grab # pyproject.toml version info with python3.11 - print("\nšŸŽ‰ v0.15.0\n") + print("\nšŸŽ‰ v0.15.1\n") return True diff --git a/onboardme/help_text.py b/onboardme/help_text.py index 2ed7bece..a1783466 100755 --- a/onboardme/help_text.py +++ b/onboardme/help_text.py @@ -34,7 +34,7 @@ def options_help(): steps = pretty_choices(DEFAULTS['steps'][OS[0]]) pkg_mngrs = pretty_choices(DEFAULTS['package']['managers'][OS[0]]) logging_choices = pretty_choices(['DEBUG', 'INFO', 'WARN', 'ERROR']) - pkg_groups = pretty_choices(['devops', 'media', 'gaming']) + pkg_groups = pretty_choices(['default', 'devops', 'gui', 'gaming']) return { 'log_level': @@ -61,11 +61,11 @@ def options_help(): '[option]--git_url[/option] repo.', 'pkg_managers': - f'Specific [meta]PKG_MANAGER[/] to run. Choices: {pkg_mngrs}' + f'Specific [meta]PKG_MANAGER[/] to run. {pkg_mngrs}' '\nExample: [switch]-p[/] [meta]brew[/] [switch]-p[/] [meta]pip3.11', 'pkg_groups': - f"Package groups to install. Choices: {pkg_groups}\nExample:" + f"Package groups to install. {pkg_groups}\nExample:" " [switch]-g[/] [meta]devops[/] [switch]-g[/switch] [meta]gaming", 'remote_host': diff --git a/onboardme/ide_setup.py b/onboardme/ide_setup.py index fae7794d..e8c30944 100644 --- a/onboardme/ide_setup.py +++ b/onboardme/ide_setup.py @@ -82,19 +82,26 @@ def neovim_setup(): def font_setup(): """ - Clones nerd-fonts repo and does a sparse checkout on only mononoki and - hack fonts. Also removes 70-no-bitmaps.conf and links 70-yes-bitmaps.conf + On macOS: + taps a brew cask and installs mononoki and hack fonts + On Linux: + Clones nerd-fonts repo and does a sparse checkout on only mononoki and + hack fonts. Also removes 70-no-bitmaps.conf and links 70-yes-bitmaps.conf - Then runs install.sh from nerd-fonts repo - - ripped out of setup.sh recently: - # we do this for Debian, to download custom fonts during onboardme - if [[ "$OS" == *"Linux"* ]]; then - mkdir -p ~/.local/share/fonts - fi + Then runs install.sh from nerd-fonts repo """ + print_header('šŸ“ [i]font[/i] installations') + + if 'Darwin' in OS: + # tap special cask for various terminal fonts + subproc(["brew tap homebrew/cask-fonts", + "brew install --cask font-mononoki", + "brew install --cask font-hack-nerd-font"]) + if 'Linux' in OS: - print_header('šŸ“ [i]font[/i] installations') + # not sure if needed anymore + # mkdir -p ~/.local/share/fonts + fonts_dir = f'{HOME_DIR}/repos/nerd-fonts' # do a shallow clone of the repo diff --git a/onboardme/pkg_management.py b/onboardme/pkg_management.py index 86e4b012..0f058374 100755 --- a/onboardme/pkg_management.py +++ b/onboardme/pkg_management.py @@ -2,86 +2,42 @@ from os import path # custom libs -from .env_config import OS, PWD, load_yaml -from .console_logging import print_header, print_msg +from .env_config import OS, PWD, HOME_DIR, load_yaml +from .console_logging import print_header from .console_logging import print_sub_header as sub_header from .subproc import subproc -def brew_install_upgrade(package_groups=['default']): - """ - Run the install/upgrade of packages managed by brew, also updates brew - Always installs the .Brewfile (which has libs that work on both mac/linux) - Accepts args: - * os - string arg of either Darwin or Linux - * devops - bool, installs devops brewfile, defaults to false - """ - brew_msg = '[green][b]brew[/b][/] app Installs/Upgrades' - print_header('šŸŗ ' + brew_msg) - - install_cmd = "brew bundle --quiet" - - if 'default' in package_groups: - subproc(['brew update --quiet', - 'brew upgrade --quiet', - f'{install_cmd} --global']) - - # install os specific or package group specific brew stuff - brewfile = path.join(PWD, 'config/brew/Brewfile_') - - # sometimes there isn't an OS specific brewfile, but there always is 4 mac - os_brewfile = path.exists(brewfile + OS[0]) - - if os_brewfile or package_groups: - install_cmd += f" --file={brewfile}" - - if os_brewfile: - os_msg = f'[b]{OS[0]}[/b] specific package installs...' - sub_header(os_msg) - subproc([f'{install_cmd}{OS[0]}'], error_ok=True) - print_msg(f'{OS[0]} specific packages installed.') - - if package_groups: - for group in package_groups: - group_file = brewfile + group - if group != "default" and path.exists(group_file): - # Installing devops specific brew app Installs/Upgrades - msg = f"{group.title()} specific package installs..." - sub_header(msg) - subproc([f'{install_cmd}{group}'], error_ok=True) - print_msg(f'{group.title()} specific packages installed.') - - # cleanup operation doesn't seem to happen automagically :shrug: - sub_header('[b]brew[/b] final cleanup') - subproc(['brew cleanup']) - print_msg('Cleanup completed.') - return - - def run_pkg_mngrs(pkg_mngrs=[], pkg_groups=[]): """ - Installs packages with apt, brew, pip3.11, snap, flatpak. If no pkg_mngrs - list passed in, only use brew/pip3.11 for mac. Takes optional variable, - pkg_group_lists to install optional packages. - Returns True. + Installs brew and pip3.11 packages. Also apt, snap, and flatpak on Linux. + Takes optional variables: + - pkg_groups: list of optional package groups + - pkg_mngrs: list of package managers to run + Returns True """ - pkg_mngrs_list_of_dicts = load_yaml(path.join(PWD, 'config/packages.yml')) + # check to make sure the user didn't pass in their own packages.yml + user_packages = path.join(HOME_DIR, '.config/onboardme/packages.yml') + if path.exists(user_packages): + pkg_mngrs_list_of_dicts = load_yaml(user_packages) + else: + default_config = path.join(PWD, 'config/packages.yml') + pkg_mngrs_list_of_dicts = load_yaml(default_config) + log.debug(f"pkg_mngrs: {pkg_mngrs}", extra={"markup": True}) log.debug(f"pkg_groups: {pkg_groups}", extra={"markup": True}) # we iterate through pkg_mngrs which should already be sorted for pkg_mngr in pkg_mngrs: - # brew has a special flow with "Brewfile"s - if pkg_mngr == 'brew': - if any(check in pkg_groups for check in ['devops', 'default']): - brew_install_upgrade(pkg_groups) - # skip everything below because install process already covered - continue - pkg_mngr_dict = pkg_mngrs_list_of_dicts[pkg_mngr] required_pkg_groups = pkg_mngr_dict['packages'] + # brew has a special flow because it works on both linux and mac + if pkg_mngr == 'brew': + if 'Darwin' in OS: + pkg_groups.append("macOS") + debug_line = f"pkg groups for {pkg_mngr} are {required_pkg_groups}" log.debug(debug_line, extra={"markup": True}) @@ -112,7 +68,6 @@ def run_pkg_mngrs(pkg_mngrs=[], pkg_groups=[]): install_pkg_group(installed_pkgs, required_pkg_groups[pkg_group], pkg_cmds['install']) - sub_header(f'{pkg_group.title()} packages installed.') if 'cleanup' in pkg_cmds: diff --git a/pyproject.toml b/pyproject.toml index 6c05d0c8..fffa0365 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "onboardme" -version = "0.15.0" +version = "0.15.1" description = "An onboarding tool to install dot files and packages including a default mode with sensible defaults to run on most Debian/macOS machines." authors = ["Jesse Hitch "] license = "AGPL-3.0-or-later"