Overview

Set up a new linux machine from a clean install using Ansible and Stow.

This abuses Ansible intended purpose by running a playbook locally.

It is run by cloning to ~/.dotfiles (any other directory should work) then run scripts and ansible-playbooks using the provided Makefile.

The exact roles being run can be configured per host using the hostname. The roles are associated to each host in the root playbook file site.yml.

Only the host that matches the local hostname are ran. This is the case because the inventory file hosts is generated during bootstrap, listing only the name of the current host. If you're configuring a new host you'll have to add a new entry to site.yml.

Under each entry in the roles directory, you'll find standard sub-directories such as files, tasks, or meta. You'll also find the non-standard stow sub-directory, which contains files to be symlinked (usually from user's home). This allows us to edit the files in their normal placement in the file system while automatically updating the ~/.dotfiles repo. These changes can then be committed.

Installation on a fresh system

0. [DBG-Only] Before you start

Step 0.1

  • Click on the upper right menu.
  • Click on "Wired unmanaged" > "Wired Settings"
  • It will open a window. you will need to click on the "gear" icon for network proxy.
  • Click on automatic and write the following url
http://webproxy.deutsche-boerse.de:8080

To check that it works by opening firefox and login to your github account.

Step 0.2

Setup the proxy for curl copy paste this to the terminal.

export https_proxy=http://webproxy.deutsche-boerse.de:8080

1. Run the init script.

Open this link to get an authenticated url of the init script and copy it. click me

curl <replace with the link here> | bash

The script with generate a ssh key for you, open github so you register the key and clone this repo to continue the installation of the whole environment.

3. [Optional] Make sure there's a playbook entry for the current hostname and add it if necessary

vi ~/.dotfiles/site.yml
touch "$HOME/.dotfiles/roles/common/stow/bashrc/.bashrc.hosts.d/$(hostname).bashrc"
git commit -Am "Adding host $(hostname)"

4. Install bootstrap dependencies and setup environment

cd ~/.dotfiles
make install

5. Run the Ansible playbook to synchronize changes

make sync

6. [Optional] Select the custom keyboard layout

  • Settings > Region & Language > Input Sources > + > English (US) > English (US Int AltGr, Custom by Rod)
  • This seems to require a restart

7. [Optional] Install Doom Emacs

~/.emacs-profiles/doom-emacs/bin/doom install
~/.emacs-profiles/doom-emacs/bin/doom sync

(doom should be in the PATH by this point so you can also run it directly if you open a new terminal).

8. Run Jetbrains Toolbox for the first time and install IntelliJ IDEA

/opt/jetbrains-toolbox-1.21.9712/jetbrains-toolbox

After the first run the Jetbrains Toolbox desktop link will be registered. Use the GUI to install IntelliJ IDEA.

9. [DBG-only] Configure proxy and license in IntelliJ IDEA

  • Open the toolbox and click on the "gear icon" > "proxy" > HTTP
Address: webproxy.deutsche-boerse.de
Port: 8080  
  • Click to install IDEA Ultimate

  • Click to open IDEA and register with license server**

https://jetbrains.deutsche-boerse.de
  • **If you have problems try by disabling the proxy from the toolbox.

  • Once IDEA is registered in the Welcome panel go to "Customize">"All Settings">"Appearance & Behavior">"Sytem Settings">"HTTP Proxy"

    • Manual HTTP Proxy:
      • host: webproxy.deutsche-boerse.de
      • port: 8080
      • No proxy for: *.deutsche-boerse.de

10. [DBG-only] Configure proxy in DBeaver

  • Open DBeaver
  • Click on window tab
  • Click on Preferences
  • Search for proxy
  • You should be seeing two options:
    • Network Connections:
      • Double click on HTTP in proxy entries
        • host: webproxy.deutsche-bourse.de
        • port: 8080
      • Do the same for HTTPS
        • host: webproxy.deutsche-bourse.de
        • port: 8080
    • Drivers:
      • host: webproxy.deutsche-bourse.de
      • port: 8080
  • Click on Apply and close
  • Close the application completely
  • Reopen DBeaver
  • You should now be able to connect to Microsoft SQL Server !

11. [Optional] Pull current keyboard shortcuts, commit and check other machine configs for inspiration

cd ~/.dotfiles/keybindings
./pull
vim "media-keys/$(hostname).dconf

This is too personal machine-dependent to fully automate at this point. So these scripts just make it easy to track your changes in different machines.

Caveats

  • The keylayout setup script removes the comments from evdev.xml. This could be fixed by using lxml or injecting the comments.
  • Only works for Ubuntu and Pop!_OS right now

How-To's

Track Org files in git when using Dropbox

Create a separate git root to keep it out of Dropbox:

mkdir ~/.gitroots
git clone --separate-git-dir="/home/rodelrod/.gitroots/org.git" git@gitlab.com:rodelrod/org.git ~/Dropbox/Org

Check for changes in Gnome key bindings

cd keybindings && ./pull && git diff

Un-stowing packages

Useful after moving packages to a different role due to a refactoring.

cd roles/{ROLE}/stow
stow -D -t ~ {PACKAGE}

Get the submodules (vim or others)

  1. git submodule init {PACKAGE}
  2. git submodule update --merge

or maybe

  1. `git submodule update --init --recursive