Files
tooling/wsl-setup.org
2019-09-01 18:20:04 +12:00

3.2 KiB

Windows Subsystem for Linux Setup

Update and install packages

To get started we ensure the package manager is up to date.

sudo apt-get update && sudo apt-get upgrade

Next we install a series of standard packages that form part of our workflow or are dependencies for other tools in our environment.

sudo apt-get install -y git curl wget tmate locales xclip tmux net-tools less
\ software-properties-common htop wget

We use pandoc for documentation export from spacemacs.

curl -L -O https://github.com/jgm/pandoc/releases/download/2.7.3/pandoc-2.7.3-1-amd64.deb  
sudo dpkg -i /tmp/pandoc-2.7.3-1-amd64.deb

For additional package management we use node. The code below installs node 12.

sudo curl  -sL https://deb.nodesource.com/setup_12.x | bash -
sudo apt-get install -y nodejs

For managing secrets we use bitwarden which provides a great cli utility.

export account=[BITWARDEN_ACCOUNT]
sudo npm install -g @bitwarden/cli 
bw login $account

Install spacemacs

A key component in our environment is spacemacs. The section below will setup version 27.0.50 of emacs and then spacemacs on top.

git clone -b stable  --depth=1 https://github.com/ii/emacs
sudo apt-get install autoconf make gcc texinfo libgtk-3-dev libxpm-dev libjpeg-dev libgif-dev libtiff5-dev libgnutls28-dev libncurses5-dev
cd /emacs/
./autogen.sh
./configure.sh
make
sudo make install

After compiling and installing emacs we should verify that version 27.0.50 is installed.

emacs --version

Setup a local emacs pacakge mirror

To save time we will setup a local mirror for all the LISP files that we need as part of spacemacs. Depending on your machine and internet connection it may take some time to download, configure and compile.

sudo git clone --depth 1 -b stable https:/github.com/ii/elpa-mirror /usr/local/elpa-mirror

Setup spacemacs within our home folder.

git clone --depth 1 -b stable --recurse-submodules https://github.com/ii/spacemacs.git ~/.emacs.d
ln -sf ~/.emacs.d/private/local/dot-spacemacs/.spacemacs ~/.spacemacs
emacs --batch -l ~/.emacs.d/init.el

Setup environment dotfiles

Within wsl we can use .dotfiles to further customise our environment. The script below restores my versions of key dotfiles automatically.

git clone ssh://git@gitlab.jamma.life:2224/jmhbnz/tooling.git
cd /tooling/
mv * ~/