Skip to content

A Kitchen Sink Development Environment

License

Notifications You must be signed in to change notification settings

marvinpinto/kitchensink

Repository files navigation

A Kitchen Sink Development Environment

kitchen sink logo

OSX Manual Preparation

Install Xcode:

xcode-select --install

Linux Manual Preparation

  1. Boot up the machine with the USB key in place and manually install a recent Ubuntu Desktop LTS release.

  2. For the main machine, hit F12 on startup and select USB Storage Device.

  3. After the installation process completes, disable power saving & screen lock (so that the bootstrap process proceeds without complications). Power Button (top right) -> Settings -> Power > Blank Screen -> Never.

  4. After the installation process completes, install a few bootstrap utilities to get going:

sudo apt-get install -y curl ca-certificates

Software Setup

Initialize the software installation process with homebrew and a few other basics:

bash -xec "$(curl -L https://raw.githubusercontent.com/marvinpinto/kitchensink/main/bootstrap.sh)"

When bootstrapping the machine, clone the kitchensink repo locally and run the manifest from within there:

git clone https://github.com/marvinpinto/kitchensink.git /tmp/kitchensink
cd /tmp/kitchensink

Setup the homebrew path initially:

# linux
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# osx
eval "$(/usr/local/bin/brew shellenv)"

Run ansible to install & manage all the sytem components:

ANSIBLE_VERBOSITY=2 make machine

Bootstrap the 1password CLI (for secrets), export the specified env vars after it completes:

make op-init

Validate that the 1password cli create the config file correctly, sometimes this does not work on the first try for whatever reason:

[[ -e "${HOME}/.openv-cfg-dir/config" ]] && true || echo "1password CLI did NOT initialize successfully, re-run: make op-init"
export OP_CONFIG_DIR=/tmp/openv-XXXXXXXXXX
export OP_SESSION_my=XXXXXXXXXXX

Initialize the dotfiles using chezmoi:

make chezmoi-init

Post Software Setup

  • osx/linux: reboot the machine and log back in

  • osx: If a homebrew cask/cli app throws a "cannot be verified" error, ctrl+click the app icon in Finder/Applications, and then choose "Open". This effectively saves the exception in security settings and it should not throw this error again.

  • osx: Manual keyboard preference changes (System Preferences -> Keyboard):

    • Keyboard: Adjust keyboard brightness in low light (enable)
    • Keyboard: Turn keyboard backlight off after 5 secs of inactivity (enable)
    • Modifier Keys: Change Caps lock to Ctrl
    • Shortcuts -> Accessibility: Map Cmd+Q to "Invert Colors"
  • osx: Install divvy and tailscale from the App Store and ensure they both run on startup.

  • linux: Apply any updated software patches using the yoloupdate alias.

  • osx/linux: Add the core AWS vault credentials:

    export OP_AWS_MFA_NAME=AWS-useraccount-marvin-dev
    ave-init marvin
  • osx/linux: Reboot the machine at least once to verify everything worked correctly.

Using the Kitchensink Tap

The HomebrewFormula directory contains a bunch of linux CLI & AppImage maps for use as Homebrew installations.

Add the kitchensink tap as follows:

brew tap marvinpinto/kitchensink "https://github.com/marvinpinto/kitchensink.git"

Then install a formula as follows - using digikam as an example:

brew install marvinpinto/kitchensink/digikam

Development within VSCode Remote Containers

Combining remote containers with automatically setup dotfiles enables very powerful throwaway dev environments.

See the example devcontainer.json and my vscode settings.json file for inspiration.

Throwaway Environments from the Command Line

Aside from automatically creating environments in VSCode, this can also be used to to generate throwaway environments/containers from the command line. This has only been used on Linux and probably won't work with OSX.

Using the sink bash function, this would create a temporary environment to experiment in, without affecting the host. Would look something like this:

[mp-desktop: 19:56:07] ~
$ sink test-env
Creating new docker container
Cloning into '/home/worker/dotfiles'...
remote: Enumerating objects: 1039, done.
remote: Counting objects: 100% (364/364), done.
remote: Compressing objects: 100% (242/242), done.
remote: Total 1039 (delta 159), reused 294 (delta 97), pack-reused 675
Receiving objects: 100% (1039/1039), 321.92 KiB | 4.13 MiB/s, done.
Resolving deltas: 100% (495/495), done.

[test-env: 19:56:32] ~
# echo "hello from within test-env"
hello from within test-env

[test-env: 19:56:55] ~
# exit
exit

The above function creates the container (from the Dockerfile image), optionally mounts a source directory, then initializes the dotfiles within the container using chezmoi.

Troubleshooting Tips

Use the following to discover ansible built-in variables:

ansible localhost -m ansible.builtin.setup | less

License

The source code for this project is released under the MIT License.

Credits

The original incantation of this project was inspired by github.com/shykes/devbox. The logo was made by github.com/des4maisons.