# Bring your setup to every workstation

> For the complete documentation index, see [llms.txt](https://docs.ringleader.dev/llms.txt).


> Put your dotfiles repository, shell lines and a few packages on every workstation you own with one personal layer.


Put your dotfiles repository, shell lines and a few packages on every workstation you own
with one personal layer. Use it when you want each new workstation to feel like yours from
the first shell, without setting it up by hand.

## Prerequisites

- [Ringleader installed](https://docs.ringleader.dev/install/), with the Ringleader application
  running.
- A running workstation that you own. The examples use a workstation named `my-box`;
  replace it with yours. To create one, follow the [Quickstart](https://docs.ringleader.dev/quickstart/)
  and use your own name.
- A dotfiles repository that anyone can clone.

## Add your personal layer

Apply a personal layer: one WorkstationConfig that reaches every workstation you own.
[Personal layers](https://docs.ringleader.dev/workstations/configuration/configuration-layers/#personal-layers)
says what one is, and to keep it to settings that are safe on any workstation.

1. Save this as `my-setup.yaml`, with your own dotfiles URL and shell lines:

   ```yaml
   apiVersion: workstations.ringleader.dev/v1
   kind: WorkstationConfig
   metadata:
     name: my-setup
   spec:
     selector:
       ownerScope: true      # no matchLabels, which is what makes it personal
     dotfilesRepo:
       url: <your-dotfiles-url>   # replace with your repository's clone URL
     dotfiles:
       ".bashrc": |
         alias ll='ls -la'
     packages:
       - ripgrep
   ```

   [Code, dotfiles and trusted folders](https://docs.ringleader.dev/workstations/packages-tools-settings/code-dotfiles-trusted-folders/)
   describes `dotfilesRepo` and `dotfiles`, and
   [Package installation](https://docs.ringleader.dev/workstations/packages-tools-settings/package-installation/) describes
   `packages`.

2. Preview the change. The command changes nothing:

   ```bash
   rl diff -f my-setup.yaml
   ```

   The output shows `my-setup` as a new object. The command exits with status 1 when it
   finds differences, which is not an error.

3. Apply the file. The file names no namespace, so it goes into your current namespace,
   `local` unless you changed it, and reaches every workstation you own there:

   ```bash
   rl apply -f my-setup.yaml
   ```

4. Wait until the workstation has applied it:

   ```bash
   rl workstation wait my-box --for Configured --timeout 10m -n local
   ```

   The command returns once the workstation's `Configured` condition is `True`.

## Check the resolved configuration

Read the configuration that Ringleader works out for a workstation, to confirm that your
layer reached it.

1. Print the resolved configuration:

   ```bash
   rl workstation get-resolved-configuration my-box -n local
   ```

2. Under `appliedConfigs`, find `my-setup`. It has `source: selector` and priority 75.
3. Under `effective`, find `ripgrep` in `packages`. The same section lists your dotfiles
   repository.

[Read a workstation's resolved configuration](https://docs.ringleader.dev/workstations/configuration/configuration-merging-resolution/#read-a-workstations-resolved-configuration)
says what each key holds.

## Troubleshoot

- If `my-setup` isn't under `appliedConfigs`, check that the layer's `selector` sets
  `ownerScope: true` and names no labels, and that you own the workstation. A personal layer
  doesn't reach a teammate's workstation.
- If `my-setup` is listed with `refused: true`, its `reason` says why Ringleader dropped it.
- If your dotfiles repository fails to install, the workstation still becomes available.
  A step from a personal layer doesn't block the workstation by default. Read the step's
  error with `rl workstation describe my-box -n local`, then fix the `url`.

## Next steps

- [Personal layers](https://docs.ringleader.dev/workstations/configuration/configuration-layers/#personal-layers)
  says which workstations a personal layer reaches, and how it ranks against other layers.
- [Dotfiles repository](https://docs.ringleader.dev/reference/resources/workstationconfig/#dotfiles-repository)
  lists every field, including `credentialRef` for a private repository.

