Skip to content

Commit

Permalink
Merge pull request #180 from jessebot/move-default-configs
Browse files Browse the repository at this point in the history
v1: remove support for vim; switch to lazy.nvim for packer; reworking how we process configurations
  • Loading branch information
cloudymax authored Mar 18, 2023
2 parents 84cb2d8 + ff3cb69 commit 05bbf12
Show file tree
Hide file tree
Showing 19 changed files with 204 additions and 631 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ coverage.xml
# any locally generated log stuff:
*.log

# Flask stuff:
instance/
.webassets-cache

# PyBuilder
target/

Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/python-poetry/poetry
rev: '1.2.2'
hooks:
# make sure the poetry config does not get committed in a broken state
- id: poetry-check
# make sure the lock file is up-to-date when committing changes
# - id: poetry-lock
41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Contributing
Always happy to review pull requests and merge any fixes, or features, that would help onboardme.

Here's some guidelines on how we code.

## Getting Started

<details>
<summary><bold>Prereqs</bold><summary>

- Install [poetry], which we use for dependency management and packaging in python.

- If using vim/neovim, we recommend installing the [jedi language server]. onboardme will install it for you with the following:
```bash
# if you have existing dot files that you don't mind overwriting, use append -O
onboardme -s dot_files,neovim_setup --git_url https://github.com/jessebot/onboardme.git
```

</details>

Once you have the pre-reqs installed you can fork the [repo] and then clone your fork:

```bash
# this should be YOUR fork, but for an example, we're using the actual repo
git clone [email protected]:jessebot/onboardme.git
cd onboardme
```

Use `poetry` and `pre-commit` to install onboardme depedencies:
```bash
poetry install
pre-commit install
```

Now you can proceed as normal for python development and when you're done, just commit the changes and the pre-commit hooks will run any linting and tests we have. When everything passes, open up a PR against the main repo and we'll get it reviewed :)


[repo]: https://github.com/jessebot/onboardme/ "onboardme repo"
[pre-commit]: https://pre-commit.com/#install "pre-commit, for running actions before commits"
[poetry]: https://python-poetry.org/docs/#installation "poetry, tool for dependency management and packaging in Python"
[jedi language server]: https://github.com/pappasam/jedi-language-server#editor-setup
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ We install and upgrade libraries and apps using common package managers.
<details>
<summary>onboardme provides a currated list of default packages</summary>

- checkout the [default packages](./onboardme/config/packages.yaml)
- checkout the [default packages]
- supports `brew`, `apt`, `snap`, `flatpak`, and `pip` (and you can add your own 😄)
- group together packages for different kinds of environments
- onboardme provides default package groups:
Expand All @@ -52,21 +52,18 @@ We install and upgrade libraries and apps using common package managers.
</details>

### NeoVim Plugin Installtion and Updates
onboardme keeps your neovim plugins installed and up to date with [packer] under the hood.
(Lazy support rolling out soon)
onboardme keeps your neovim plugins installed and up to date with [lazy.nvim] under the hood.

<details>
<summary>Why no vim though?</summary>

If you haven't already made the switch from Vim to [NeoVim], you can try out NeoVim today with `onboardme` :D We used to support both neovim _and_ vim, but these days none of the primary developers of this repo use pure vim anymore, so we can't ensure it's up to standards. All of your knowledge from vim is still helpful in neovim though, and we highly recommend switching as neovim has a lot more features and a very active plugin community :) NeoVim maintains a guide on how to switch from vim [here](https://neovim.io/doc/user/nvim.html#nvim-from-vim).

We will stop official support for configuring vim, outside of installing the package across Debian/MacOS, in v1.0.0. This just means we won't be running anything to configure your vim plugins anymore, but you can still always add it to a package manager in [`packages.yaml`](#configuration).

</details>

### Easy `yaml` config files
- [XDG Base Directory Spec] use for [config files](#configuration)
- Uses `$XDG_CONFIG_HOME/onboardme/onboardme_config.yml` and `$XDG_CONFIG_HOME/onboardme/packages.yml`
- Uses `$XDG_CONFIG_HOME/onboardme/config.yml` and `$XDG_CONFIG_HOME/onboardme/packages.yml`

### Other useful (but optional) configurations
- Enable touchID for sudo on macOS
Expand Down Expand Up @@ -145,7 +142,7 @@ onboardme has lots of CLI options, but you can also use config files. You have t
Config files are in `~/.config/onboardme/` (will use `$XDG_CONFIG_HOME`, if defined). Examples below:

<details>
<summary><code>config.yaml</code></summary>
<summary><code>config.yml</code></summary>


```yaml
Expand All @@ -165,7 +162,7 @@ steps:
- packages
# adds nerdfonts
- font_setup
# runs :PackerSync
# runs :Lazy sync to install all your plugins
- neovim_setup
# sets up touchID for sudo
- sudo_setup
Expand Down Expand Up @@ -280,9 +277,10 @@ Get started with testing kubernetes locally, even on metal with [smol k8s lab](h
[default dot files]: https://github.com/jessebot/dot_files "default dot files for onboardme"
[help text]: https://raw.githubusercontent.com/jessebot/onboardme/main/docs/onboardme/screenshots/help_text.svg "an svg of the command: onboardme --help"
[Getting Started Docs]: https://jessebot.github.io/onboardme/onboardme/getting-started "getting started documentation"
[default packages]: https://github.com/jessebot/dot_files/blob/main/.config/onboardme/packages.yml "default installed packages for onboardme"

<!-- external link references -->
[dot files]: https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory#Unix_and_Unix-like_environments "wiki entry for dot file explanation"
[XDG Base Directory Spec]: https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html
[NeoVim]: https://neovim.io/ "neovim, vim improved"
[packer]: https://github.com/wbthomason/packer.nvim
[lazy.nvim]: https://github.com/folke/lazy.nvim "lazy.nvim, a plugin manager for neovim"
File renamed without changes.
1 change: 0 additions & 1 deletion Dockerfile.setup → docker/Dockerfile.setup
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ USER friend

# Run setup.sh
RUN wget https://raw.githubusercontent.com/jessebot/onboardme/main/setup.sh && \
chmod +x setup.sh && \
chmod 777 setup.sh && \
yes| /bin/bash setup.sh
4 changes: 1 addition & 3 deletions docs/ide/neovim/neovim.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ After that, launch neovim with `nvim` and then do your normal plugin manager flo

## Plugins

Most plugins will work out of the box, but you'll probably have issues with
Python plugins. You can learn more about those and other things to do with vim-plug
and packer [here](https://jessebot.github.io/onboardme/neovim/plugins).
Most plugins will work out of the box, but you'll probably have issues with Python plugins. You can learn more about those and other things to do with vim-plug, lazy, and packer [here](https://jessebot.github.io/onboardme/neovim/plugins).

## Known issues between vim and neovim

Expand Down
33 changes: 14 additions & 19 deletions docs/onboardme/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,17 @@ onboardme --help

### Config files

`onboardme` uses a `config.yaml` in its installation directory that has defaults.
`onboardme` uses a `config.yml` in its installation directory that has defaults.
Those defaults can be altered per machine by creating a config file like:

<details>
<summary>`~/.config/onboardme/config.yaml`</summary>
<summary>`~/.config/onboardme/config.yml`</summary>

```yaml
---
# ______________________________________________________________ #
# Config file for the onboardme cli command. #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# - This is the default config file that pip will install into: #
# $PYTHON_PATH/lib/onboardme/config/onboardme_config.yaml #
# #
# - If this files exists as: ~/.config/onboardme/config.yaml #
# then its loaded instead of the default config #
# Config file for the onboardme cli: #
# ~/.config/onboardme/config.yml #
# -------------------------------------------------------------- #

log:
Expand Down Expand Up @@ -81,8 +76,10 @@ Those defaults can be altered per machine by creating a config file like:
dot_files:
# personal git repo URL for your dot files, defaults to jessebot/dot_files
git_url: "https://github.com/jessebot/dot_files.git"

# the branch to use for the git repo above, defaults to main
git_branch: "main"

# !CAREFUL: runs a `git reset --hard`, which will overwite/delete files in ~
# that conflict with the above defined git repo url and branch.
# You should run the following to get the files that would be overwritten:
Expand Down Expand Up @@ -110,8 +107,6 @@ Those defaults can be altered per machine by creating a config file like:
# uncomment these to add them as default installed package groups
# - gaming
# - work
#
# Coming soon: to edit the specific packages: ~/.config/onboardme/packages.yaml

# known safe remote hosts that you expect to be able to ping and SSH into
remote_hosts: []
Expand All @@ -128,7 +123,7 @@ Those defaults can be altered per machine by creating a config file like:
</details>
We also use a package file called
[`packages.yaml`](https://github.com/jessebot/onboardme/blob/main/onboardme/config/packages.yaml)
[`packages.yml`](https://github.com/jessebot/dot_files/blob/main/.config/onboardme/packages.yml)
which you can also place in your `~/.config/onboardme` directory, to take
precedence over our defaults.

Expand All @@ -137,13 +132,13 @@ precedence over our defaults.
Steps refer to a specific function in the list of functions we run and can be
configured for both macOS and Linux seperately. These steps include:

- setting up dot files in your home directory (.bashrc, .vimrc, etc)
- setting up dot files in your home directory (.bashrc, etc)
- managing packages using package managers (brew, pip3.11, apt, snap, flatpak)
- installing fonts
- setting up basic TUI IDE, neovim (vim is optional)
- setting up groups

They can be configured via the `steps` parameter in the `config.yaml` above,
They can be configured via the `steps` parameter in the `config.yml` above,
or via the the cli like:

```bash
Expand All @@ -170,15 +165,15 @@ The dot files for your home directory are installed from a git URL and branch
that you can configure either via the config file, or the cli. If your local
files conflict with the files in the repo, we will not overwrite them by default.
If you always want your local dot files overwritten, you can pass in the `-O` switch
or `--overwrite` option or set `overwrite` in your local `~/.config/onboardme/config.yaml`.
or `--overwrite` option or set `overwrite` in your local `~/.config/onboardme/config.yml`.

### `onboardme` cli
```bash
# run onboardme with a custom git url and branch that overwrites existing files
onboardme --git_url https://github.com/jessebot/dot_files.git --git_branch main --overwrite
```

### `config.yaml`
### `config.yml`

```yaml
dot_files:
Expand All @@ -191,7 +186,7 @@ dot_files:
### Package Management
All of the packages are installed using package managers, and each package
manager has groups of packages they can install. You can specify specific
package _managers_ and package _groups_ via the `config.yaml` file, or via the cli.
package _managers_ and package _groups_ via the `config.yml` file, or via the cli.

By default, we install the `default` package _groups_ for all package _managers_.
This includes everything you need for a basic cli experience and a slim ide.
Expand All @@ -213,7 +208,7 @@ slim ide PLUS GUI tools, like vlc and freetube.
onboardme --pkg_groups default --pkg_groups gui
```

##### `config.yaml`
##### `config.yml`

```yaml
package:
Expand All @@ -233,7 +228,7 @@ _Note: This will not install/upgrade the default package group._
onboardme --pkg_managers brew --pkg_groups devops
```

##### `config.yaml`
##### `config.yml`

```yaml
package:
Expand Down
3 changes: 0 additions & 3 deletions docs/onboardme/known_nonsense.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ permalink: /onboardme/known_nonsense

# Problems we're aware of that are caused externally

## vim
- [:python3 command broken in vim after python3.10.6_2 -> 3.10.7 upgrade](https://github.com/orgs/Homebrew/discussions/3734)

## misc
- [perl: warning: Setting locale failed](https://github.com/jessebot/onboardme/issues/87)
4 changes: 2 additions & 2 deletions docs/onboardme/onboardme.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Here's the steps we take depending on what OS we run on. Each step can also be c
| Git fetch dot files | n/a: fetched from a configured git repo | Debian, macOS |
| Installs apps using package managers | `./onboardme/config/packages.yaml` | Debian, macOS |
| Installs fonts | n/a | Debian, macOS |
| Installs packer.nvm + neovim plugins | plugins fetched from configured git repo | Debian, macOS |
| Installs lazy.nvim + neovim plugins | plugins fetched from configured git repo | Debian, macOS |
| Adds user to the docker group | n/a | Debian |
| sudo using touchID | n/a | macOS |

Expand Down Expand Up @@ -151,4 +151,4 @@ It works great in combination with onboardme :)
[w3m]: https://w3m.sourceforge.net/ "w3m home page"
[WireGuard]: https://www.wireguard.com/ "wireguard home page"
[XDG Base Directory Spec]: https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html
[packer]: https://github.com/wbthomason/packer.nvim
[lazy.nvim]: https://github.com/folke/lazy.nvim "lazy.nvim, a plugin manager for neovim"
Loading

0 comments on commit 05bbf12

Please sign in to comment.