This repository contains various configuration files and scripts.
See e.g. Ubuntu Wiki.
By default Ubuntu with LVM and encryption creates following partitions:
LVM VG vgubuntu, LV root as ext 4
LVM VG vgubuntu, LV swap_1 as swap
partition #1 of /dev/nvme0n1 as ESP
The swap partition is by default only ~1G. In order to resize the root logical volume and increase swap do the following:
- Install Ubuntu with LVM and encryption
- Restart to 'Try Ubuntu', i.e. 'Live CD' so that root is not actively used
- Run the
increase_swap.shscript that moves 40G space from root to swap - Reboot to installed Ubuntu and continue the setup
Ubuntu release upgrades can be done using the do-release-upgrade
utility from the update-manager-core package.
One can verify that it's installed from the output of
dpkg -s update-manager-coreAs a prerequisite make sure the system is up to date:
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremoveAnd finally, run the release upgrade with
sudo do-release-upgradeor to upgrade from the latest supported release to the development release, run:
sudo do-release-upgrade -dNote that new LTS versions become available with release xx.04.1, as
explained here.
The default make target will call the $XDG_BIN_HOME/upgrade script:
makeNote that if the upgrade script has not yet been linked, then the
recipe will call it from this repository.
There is a config installation make target that links config files to dedicated locations.
WARN: Note that original files will be overwritten!
make linksFirst check whether the system runs Wayland - e.g., by looking at
XDG_SESSION_TYPE.
There is a Gnome extension alacritty-toggle, which enables toggling the visibility of the terminal window.
This extension can be installed with make alacritty-toggle which
clones the repository and configures the toggle button to F1.
Unfortunately, the extension is picked up only after restarting current Gnome session so one must logout, log back in and re-run the make target.
- Make sure GNOME Tweaks is installed
- Follow these instructions
This configuration is actually stored as .config/zsh/p10k.zsh and
automatically symlinked to $POWERLEVEL9K_CONFIG_FILE.
It is important to note that $POWERLEVEL9K_CONFIG_FILE is set in
.zshrc and uses $XDG_CONFIG_HOME. Additionally, .zshrc disables
the p10k configure configuration wizard.
Therefore, if one deliberately wants to run it, the wizard must be re-enabled with
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=false p10k configureAlso the XDG specification, respectively $POWERLEVEL9K_CONFIG_FILE,
should be respected if p10k.zsh ought to be rewritten by the wizard.
Generally, there are two setups which, according to the p10k documentation, respect terminal's color palette (and hence Base16):
- Lean prompt style with 8 colors
- Rainbow prompt style which currently does not offer an option to select between 8 and 256 colors (empirically 256)
Some settings used in p10k configure when p10k.zsh was originally
created include:
- Prompt Style: Rainbow or Lean
- Character Set: Unicode
- Prompt Separators: Slanted (only relevant to Rainbow)
- Prompt Heads: Slanted (only relevant to Rainbow)
- Prompt Tails: Flat (only relevant to Rainbow)
- Prompt Colors: 256 colors (only relevant to Lean)
- Show current time?: 24-hour format
- Prompt Height: Two lines
- Prompt Connection: Disconnected
- Prompt Frame: No frame
- Prompt Spacing: Sparse
- Icons: Many icons
- Prompt Flow: Concise
- Enable Transient Prompt?: same-dir
- Instant Prompt Mode: quiet
Additionally one can download
Meslo Nerd Fonts and configure terminals as
instructed. The font download is part of make fonts.
Tinted Shell can be installed with make tinted-shell.
One can then manually switch themes with base16_<theme> which creates
and/or updates a link $HOME/.config/tinted-theming/base16_shell_theme.
Note that the shell hook is already added to and liked the oh-my-zsh
plugin tinted-shell, so after installation with make one just needs
to reload zsh and pick a theme:
omz reload
base16_gruvbox-dark-hardThe default theme is set in .zshenv to
BASE16_THEME_DEFAULT=gruvbox-dark-hard.
One can also test the themes with included
colortest tool.
Note that alacritty.yml automatically imports set color schemes:
import = ["~/.config/alacritty/colors.toml"]The colors.toml is a symlink created by make alacritty which points
to a tinted-alacritty theme. Note that currently the
theme is selected just once before the installation and further changes
won't be automatically picked up.
Bat supports base16 color theme by
default via --theme=base16 option or BAT_THEME environment variable.
Current setting is BAT_THEME=base16-256 which, according to the
documentation:
is designed for
base16-shell
Custom themes are supported if appropriate file exists in
BAT_CONFIG_DIR/themes When new themes are downloaded and linked, one
must update the cache by running:
bat cache --buildand then check the theme is available via:
bat --list-themesUnless the Base16 extension is properly synced, install it and follow the instructions.
Finish Poetry setup by manually configuring auth tokens.
Nvim uses its built-in LSP support and leverages
nvim-lspconfig to configure individual LSPs. In order to
install LSP binaries for various languages, refer to corresponding
sub-section below.
Rust Analyzer is installed together with other rustup
components as part of
make rustThe Python LSP Server together with all its dependencies can be installed via:
make python-language-serverThe LuaLS can be installed via:
make lua-language-serverThe installation of the Haskell Language Server (HLS) is done as
part of ghcup installation in
make haskellSettings are automatically synchronized via build-in mechanism so one can just login to GitHub.
The nvidia-settings application does not currently support
XDG specification. The workaround is to set custom
config path using the --config option.
.envrc defines an alias for this so when running nvidia-settings
from shell it will automatically use
$XDG_CONFIG_HOME/nvidia-settings/nvidia-settings-rc as the
configuration file.
However, the desktop entry (i.e. when running the app from Gnome menu) must be edited manually. One can do this by executing the following make target:
make nvidia-settings-rc-xdg-pathThe default user script location (under $HOME) is compiled with the
shell, so the only option how to change it is modifying the system-wide
configs /etc/bash.bashrc (resp. /etc/bash.bash.logout).
There is a handy make bash target which does so automatically and
links custom files from this repository.
Since the shell in use is zsh, bash configs are not commited in this
repo. So to change the location of the ~/.bash_history file one can
manually run the following:
mkdir -p "$XDG_STATE_HOME"/bash && \
mv ~/.bash_history $XDG_STATE_HOME/bash/historyand make sure this line is in the linked bashrc:
export HISTFILE="${XDG_STATE_HOME:-$HOME/.local/state}"/bash/historyNSS data in ~/.pki should be safe to move to XDG directories, see:
bugzilla issue.
Migration commands:
mkdir -p $XDG_CONFIG_HOME/pki/nssdb $XDG_DATA_HOME/pki/nssdb && \
mv $HOME/.pki/nssdb/pkcs11.txt $XDG_CONFIG_HOME/pki/nssdb && \
mv $HOME/.pki/nssdb/*.db $XDG_DATA_HOME/pki/nssdb && \
rm -r $HOME/.pkiNote that ~/.pki might be created by other tools:
- Visual Studio Code
- Google Chrome (should support the XDG_CONFIG_HOME path if it exists)
ipython >= 8.x supports XDG. So it should be sufficient to
just run (it's not quite clear which XDG directories one should use):
mv ~/.ipython $XDG_CONFIG_HOME/ipythonResources:
- Simple installtion tutorial
- Older but comprehensive guide
- Ubuntu wiki
Whether it's even possible to setup KVM on certain system or not can be checked with
kvm-okIf the CPU supports virtualization one can install all required packages and then run following validation check
virt-host-validateTypically one can see
- WARN for IOMMU which is handled automatically by the
Makefiletarget. However, this step (and thekvmtarget in general) needs a reboot. - Another QUEMU warning which according to Ubintu wiki should be fine
Start Minikube on KVM by running
minikube start --cpus 2 --memory 2048 --vm-driver kvm2or for larger machnines
minikube start --cpus 4 --memory 8192 --vm-driver kvm2
Note that the test-k8s make target sometimes fails due to timeout
after waiting on minikube. It may also leave some resources when it does
not succeed.
Ubuntu LTS releases become available with release xx.04.1, as
explained here.
The issue manifests when the check indicates there's new LTS release:
❯ sudo do-release-upgrade -cd
Checking for a new Ubuntu release
New release '22.04 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
but it fails to do the release upgrade:
❯ sudo do-release-upgrade
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS development release
set Prompt=normal in /etc/update-manager/release-upgrades.
There are two options to solve this problem:
- Wait for the
xx.04.1release (~ 3 months from the LTS release) - Upgrade to the latest development release, as proposed in the error
message. This can be done by
sudo do-release-upgrade -d.
With Ubuntu 22.04 a notification might appear reporting "Pending Update of Snap Store".
The issue is that neither from terminal nor from Ubuntu Software
application the update works. This is because snap-store starts
automatically on login.
So first kill the process (either from command line or using System
Monitor), and then run
sudo snap refreshNote: see all pending updates by running snap refresh --list.
Missing nvidia-smi after some updates (which was working after
installation):
❯ nvidi-smi
zsh: command not found: nvidi-smi
Fixed by running following and then rebooting.
sudo ubuntu-drivers autoinstallAdvised here and empirically might work even without restart.
Other option which might work (although one should be careful with this one) is to run dist upgrade:
sudo apt dist-upgradeThe issue with "missing" drivers is that the driver packages are "kept
back" (shown in the snippet below). This is due to an incompatibility
between driver libraries and the kernel which apt cannot resolve on
its own.
❯ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
libnvidia-cfg1-460 libnvidia-compute-460 [...]
libnvidia-gl-460 libnvidia-gl-460:i386 libnvidia-ifr1-460 [...]
nvidia-utils-460 xserver-xorg-video-nvidia-460
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
As a consequence nvidia-smi is unable to communicate to the driver and
fails (see this post).
The solution is as described above (possibly combination of both approaches). Also, reboot might be necessary for the fix to take effect.
Ubuntu 22.04 (LTS) will fallback to and start with X11 on a machine with Nvidia. It's possible, however, to override this rule and run it with Wayland just fine.
Enabling Wayland requires a manual change as described
here. Additionally, also modify
/etc/gdm3/custom.conf as follows:
PreferredDisplayServer=wayland
WaylandEnable=true
XorgEnable=false
Note that on Ubunut, one can tell the session type from the
XDG_SESSION_TYPE environment variable.
If minikube continously fails to boot, and as a last resort, one can clean up the whole minikube by running:
minikube deleteor even more excessive cleanup which also deletes the ~/.minikube dir
minikube delete --purgeThe installation of cargo-audit might fail if installed manually and
the system does not have libssl-dev installed (note that if one uses
make rust-tools this should not happen).
In such case, and possibly in other situations, the advisory database might get into an invalid state.
Fortunately, according to this issue, the fix is simply to drop the database:
rm -rf $CARGO_HOME/advisory-db/Next invocation of cargo audit will fetch it again and fix the issue.
According to zsh-sdkman's
usage notes:
if you do new installations on your sdkman candidate or just play around with new versions, uninstallations or updates, don't forget to refresh the completion script files with the following command:
sdk-refresh-completion-filesAccording to this issue comment once should be
able to fix pipx installations as follows:
pipx reinstall-allAlternatively, one can reinstall pipx and the tools manually
(mentioned in the same issue that was referenced above):
- Uninstall python tools:
pipx uninstall-all - Uninstall
pipxand remove$XDG_BIN_HOME/pipxand~/.local/pipx - Re-install
pipxand tools usingmake python-tools
An indication for issues with pipx might be an error log mentioning
No module named pip
Some profiling tools (e.g. samply or flamegraph) require access to
the performance events system.
These settings can help:
sudo sysctl kernel.perf_event_paranoid=1
sudo sysctl kernel.perf_event_mlock_kb=2048Some tools (e.g. heaptrack) need adjustment of the ptrace scope:
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scopeAlso, for Rust binaries it's necessary not to strip debug symbols
from the binary. This might be the case when building/running in the
--release profile. One possibility is to add a custom profile like the
following one:
[profile.profiling]
inherits = "release"
debug = true