Skip to content

7.Dev environment

Julien Chappuis edited this page Jan 13, 2024 · 35 revisions

Introduction

The goal is to reach a complete development environment including code editors, IDEs and main dev libraries.

Java

Reference

ArchLinux Wiki on OpenJDK to get the package name for the latest version of openjdk JDK.

Install

paru -S jdk-openjdk

Python

Base python

paru -S python python-pip

Pyenv

Install Pyenv

paru -S pyenv

Configure Zsh

Add to .zshenv

##Add to $PATH
> $HOME/.pyenv

export PYENV_ROOT="$HOME/.pyenv"

Add to .zshrc

eval "$(pyenv init -)"

Configure Fish

Add to config.fish

fish_add_path $HOME/.pyenv
##Pyenv
set -Ux PYENV_ROOT $HOME/.pyenv
pyenv init - | source

Install a recent Python version

pyenv install 3.11
pyenv global 3.11

Poetry

Important
Make sure Pyenv has been installed before, and that the desired environment is sourced.

Install Poetry

cd ~/Downloads
curl -sSL https://install.python-poetry.org | python3 - (1)
  1. this python3 should be the pyenv one.

Configure Zsh

Install the Zsh completions:

mkdir ~/.zfunc
poetry completions zsh > ~/.zfunc/_poetry

Add to .zshrc, before the autoload -Uz compinit && compinit line

##Add before the autoload -Uz compinit && compinit line
fpath+=~/.zfunc
Install zsh-poetry

Automatically active the virtual env when CDing into a Poetry project

mkdir -p ~/.local/share/zsh-poetry
cd ~/.local/share/zsh-poetry
curl -L git.io/Jinm5 > poetry.zsh

Add to .zshrc

source ~/.local/share/zsh-poetry/poetry.zsh

Configure Fish

Install the Fish completions

poetry completions fish > ~/.config/fish/completions/poetry.fish
Install fish-poetry

Automatically active the virtual env when CDing into a Poetry project

fisher install 'ryoppippi/fish-poetry'

Configure Poetry

poetry config virtualenvs.in-project true

Anaconda

Install the pre-requisites :

paru -Sy libxau libxi libxss libxtst libxcursor libxcomposite libxdamage libxfixes libxrandr libxrender mesa-libgl  alsa-lib libglvnd

Download anaconda from the site https://www.anaconda.com/products/individual

bash ~/Downloads/Anaconda3-2020.02-Linux-x86_64.sh
  • Accept the install path as /home/<user>/anaconda3

  • Accept conda init (it won’t do much)

  • Configure Anaconda to work with Fish using the script :

/home/jubi/anaconda3/bin/conda init fish

Rust

Install

paru -S rustup
rustup component add rust-src rust-analyzer clippy rustfmt

Configure

Rustup (Rust toolchain)

rustup toolchain install stable
rustup default stable

Shell completions

rustup completions fish > ~/.config/fish/completions/rustup.fish
rustup completions zsh > ~/.zfunc/_rustup

Visual Studio Code (code)

Install

paru -S visual-studio-code-bin
Table 1. Extensions
Language Name Install command Description

General

Error Lens

code --install-extension usernamehw.errorlens

Inline display of compiler errors

Asciidoc

Asciidoctor

code --install-extension asciidoctor.asciidoctor-vscode

Extension for highlighting and authoring ASCIIDoctor content

Python

Python

code --install-extension ms-python.python

The Official Python extension

TOML

Even-better-toml

code --install-extension tamasfe.even-better-toml

A TOML support extension

Rust

rust-analyzer

code --install-extension rust-lang.rust-analyzer

The official Rust extension

Rust

Crates

code --install-extension serayuzgur.crates

Helper to discover creates versions in Cargo.toml

Table 2. Themes
Name Install command Description

Catppuccin

code --install-extension catppuccin.catppuccin-vsc

Catppuccin color theme

Configure

Change the font to JetBrainsMono Nerd Font Mono

Wayland

Important
Ensures VSCode configuration in ~/.config/Code/User/settings.json contains "window.titleBarStyle": "custom" or VSCode will crash upon startup.

Make sure code is run with the flags

--enable-features=WaylandWindowDecorations #(1)
--ozone-platform-hint=auto #(2)
--enable-webrtc-pipewire-capturer` #(3)
  1. prevents missing top bar issues under wayland

  2. generic flag to enable native Wayland

  3. enables Obs capture under wayland

Jetbrains Toolbox

paru –S jetbrains-toolbox

CUDA

Installation

paru –S cuda

Configure CUDA

  • Edit shell config

  • Add to $PATH : /opt/cuda/bin

  • Add to fish.config : set -gx LD_LIBRARY_PATH LD_LIBRARY_PATH /opt/cuda/lib64

Install samples

Reference

cd /data/Projects
git clone https://github.com/NVIDIA/cuda-samples.git
cd cuda-samples/Samples/1_Utilities/deviceQuery/
vim Makefile

Edit the path by changing CUDA_PATH=/opt/cuda/. This is required because the path is hardcoded in the Makefiles, and this is not the path Arch installer uses.

make (1)
./deviceQuery (2)
  1. should run with no issues

  2. will display data about the installed graphic card CUDA capabilities

You can cleanup the samples

cd /data/Projects
rm -rf cuda-samples

Docker

Install

paru –S docker
sudo systemctl enable docker.service
sudo systemctl enable containerd.service

Configure docker

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

Configure Fish

mkdir -p ~/.config/fish/completions/
curl -L https://raw.githubusercontent.com/docker/cli/master/contrib/completion/fish/docker.fish > ~/.config/fish/completions/docker.fish

Asciidoctor

Install Ruby

$ paru -S ruby ruby-bundler

Add Ruby gems to your path

## append /home/jubi/.gem/ruby/2.7.0/bin

Manim (Community)

Dependencies

paru -S cairo pango ffmpeg texlive-most texlive-fontsextra

Create project folder / virtualenv

poetry new /data/Projects/your-project

Open the /data/Projects/your-project/pyproject.toml and change the python version from python = "^3.xx" to python = "~3.xx"

poetry add pycairo
poetry add manim

Make sure to activate the virtualenv so that all those dependencies are usable.