The Unholyfile#
The only configuration used by Unholy is The Unholyfile, so let’s discuss it.
Format#
---
# This is headmatter. It is TOML.
key = "value"
[section]
key = "value"
---
#!/usr/bin/sh
# This is the script
An Unholyfile is a script with TOML headmatter.
Both the script and the headmatter are optional.
Delimiters are lines with nothing but dashes, and at least 3 of them.
If there is headmatter, it must be preceeded by a delimiter. That delimiter must by on the first line.
If there is both headmatter and a script, they must be separated by a delimiter. If there is headmatter but no script, the trailing delimiter is optional.
An empty file is valid. A file with no delimiters is interpreted as all script with no headmatter.
A script may start with a shbang (#!
). If it does, it must be on the line
immediately following the delimiter (if present).
Schema#
As documentation and information, here is the base Unholyfile (see Configuration) included in Unholy:
Note
TOML does not have a null/nil/None/etc, it only has missing keys. Commented out lines are values that default to null (aka missing).
---
#: git url
# repository = ""
#: Docker context to use
# context = ""
[dev]
#: The base image for the dev container
image = "docker.io/library/debian:latest"
#: The name of the volume containing the source
volume = "workspace"
[compose]
#: Compose file to use
file = "compose.yaml"
#: The name of the compose project
# project = ""
---
#!/bin/sh
set -e
apt-get update
# Install some basics
apt-get install -y sudo git curl gpg socat man less
# Add Docker's official GPG key:
apt-get install -y ca-certificates curl gnupg rsync
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y docker-ce-cli docker-compose-plugin
# Download neovim tarball
curl -L https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz \
| tar -xz -C /tmp
rsync -a /tmp/nvim-linux64/* /usr/
rm -rf /tmp/nvim-linux64