The Nextjournal Bash Environment

The Minimal Bash environment is the default for a Bash cell, and also serves as the base for most language images. Below is a list of installed packages.

apt list --installed

The environment is currently based off the Ubuntu 18.04 LTS Docker image.

Ubuntu Base
Download as Docker image from:
Copy
This image was imported from: ubuntu:18.04

We set the timezone and install some basic packages including gnupg and git. We've also set a number of environment variables in the runtime's settings—in particular, the value of NEXTJOURNAL_MOUNT_CUDA sets the default Nvidia CUDA and cuDNN versions for all descendant environments.

The basic packages installed include tools to aid in further package installation, such as decompression suites and git.

echo "UTC" > /etc/timezone

echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-yes

apt-get -qq update
DEBIAN_FRONTEND=noninteractive \
  apt-get install --no-install-recommends apt-utils net-tools \
  ca-certificates locales tzdata sudo \
  curl wget zip unzip gzip bzip2 xz-utils unrar p7zip-full \
  gnupg git patch \
  fontconfig fonts-dejavu fonts-liberation2
apt-get clean
rm -r /var/lib/apt/lists/* # Clear package list so it isn't stale

Generate the locale that we set in the environment variables.

locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.en LC_ALL=en_US.UTF-8

And ensure the GPU libraries can be used.

echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf.d/cuda.conf
echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf
ldconfig

Install a small selection of open fonts available on Google Fonts and here. The Nextjournal UI uses Fira Sans, Fira Mono, and PT Serif.

nj_fonts.tar.xz
cd /usr/share/fonts/
sudo tar -Jxf 
nj_fonts.tar.xz
shopt -s extglob sudo chmod -R --reference=/usr/share/fonts/truetype/dejavu \ /usr/share/fonts/!(dejavu) fc-cache -f fc-list

Configure default fonts: Nextjournal UI fonts for the generic families, and similar alternatives for some specific common fonts.

0.2s
Minimal Bash (Bash)
Ubuntu Base
echo '<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer><family>PT Serif</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Fira Sans</family></prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer><family>Fira Sans</family></prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer><family>Fira Mono</family></prefer>
  </alias>
  <alias>
    <family>Arial</family>
    <prefer><family>Liberation Sans</family></prefer>
  </alias>
  <alias>
    <family>Helvetica</family>
    <prefer><family>Liberation Sans</family></prefer>
  </alias>
  <alias>
    <family>Verdana</family>
    <prefer><family>Andika</family></prefer>
  </alias>
  <alias>
    <family>Comic Sans</family>
    <prefer><family>Comic Neue</family></prefer>
  </alias>
</fontconfig>' > /etc/fonts/local.conf