containers: add opam Apptainer task

This commit is contained in:
Hoang Nguyen 2023-11-13 00:00:00 +07:00
parent 8ed8e593e9
commit fdf8c534e1
Signed by: folliehiyuki
GPG Key ID: B0567C20730E9B11
5 changed files with 39 additions and 10 deletions

View File

@ -4,7 +4,7 @@
# Do NOT edit!!
- copy:
dest: ~/.config/starship.toml
dest: '{{ xdg_dir.config_home }}/starship.toml'
force: true
mode: "644"
src: starship.toml
@ -25,7 +25,7 @@
- foot
- alacritty
- copy:
dest: ~/.config/user-dirs.dirs
dest: '{{ xdg_dir.config_home }}/user-dirs.dirs'
mode: "644"
src: user-dirs.dirs
name: xdg-user-dirs | Configure XDG_USER_DIRS definitions

View File

@ -44,6 +44,7 @@ set -gx CABAL_DIR $XDG_DATA_HOME/cabal
set -gx SQLITE_HISTORY $XDG_DATA_HOME/sqlite/history
set -gx TS_NODE_HISTORY $XDG_DATA_HOME/ts-node/history
set -gx WINEPREFIX $XDG_DATA_HOME/wine
set -gx OPAMROOT $XDG_DATA_HOME/opam
set -gx PYENV_ROOT $XDG_DATA_HOME/pyenv
set -gx KREW_ROOT $XDG_DATA_HOME/krew
set -gx MINIKUBE_HOME $XDG_DATA_HOME

View File

@ -42,7 +42,7 @@ local docker_to_apptainer(obj) = {
if std.objectHas(obj, 'command') && std.isString(obj.command) then obj.command else obj.name,
]
),
dest: '{{ xdg_dir.bin_home }}' + obj.name,
dest: '{{ xdg_dir.bin_home }}/' + obj.name,
mode: '755',
},
},
@ -71,6 +71,12 @@ local docker_images =
image: 'docker.io/asciidoctor/docker-asciidoctor',
tag: '1.58.0',
},
{
name: 'opam',
image: 'docker.io/ocaml/opam',
tag: 'alpine-ocaml-5.2',
args: ['--env OPAMROOT="${OPAMROOT:-{{ xdg_dir.data_home }}/opam}"'],
},
{
name: 'terraform',
image: 'docker.io/hashicorp/terraform',

View File

@ -20,7 +20,7 @@
exec apptainer --silent --quiet exec \
--ipc --no-eval --no-privs --unsquash --userns --uts \
{{ xdg_dir.libexec_dir }}/bazel.sif bazel "$@"
dest: '{{ xdg_dir.bin_home }}bazel'
dest: '{{ xdg_dir.bin_home }}/bazel'
mode: "755"
name: apptainer | Create bazel-apptainer launch script
name: apptainer | Create bazel environment
@ -42,11 +42,33 @@
exec apptainer --silent --quiet exec \
--ipc --no-eval --no-privs --unsquash --userns --uts --pid --cleanenv \
{{ xdg_dir.libexec_dir }}/asciidoctor.sif asciidoctor "$@"
dest: '{{ xdg_dir.bin_home }}asciidoctor'
dest: '{{ xdg_dir.bin_home }}/asciidoctor'
mode: "755"
name: apptainer | Create asciidoctor-apptainer launch script
name: apptainer | Create asciidoctor environment
tags: asciidoctor-apptainer
- block:
- command:
cmd: rm -rf {{ xdg_dir.libexec_dir }}/opam.sif
removes: '{{ xdg_dir.libexec_dir }}/opam.sif'
name: apptainer | Clean old opam.sif file
- command:
cmd: /usr/bin/apptainer pull {{ xdg_dir.libexec_dir }}/opam.sif docker://docker.io/ocaml/opam:alpine-ocaml-5.2
creates: '{{ xdg_dir.libexec_dir }}/opam.sif'
removes: /usr/bin/apptainer
name: apptainer | Pull and build opam.sif file
- copy:
content: |
#!/bin/sh
TERM=xterm-256color \
exec apptainer --silent --quiet exec \
--ipc --no-eval --no-privs --unsquash --userns --uts --pid --cleanenv --env OPAMROOT="${OPAMROOT:-{{ xdg_dir.data_home }}/opam}" \
{{ xdg_dir.libexec_dir }}/opam.sif opam "$@"
dest: '{{ xdg_dir.bin_home }}/opam'
mode: "755"
name: apptainer | Create opam-apptainer launch script
name: apptainer | Create opam environment
tags: opam-apptainer
- block:
- command:
cmd: rm -rf {{ xdg_dir.libexec_dir }}/terraform.sif
@ -64,7 +86,7 @@
exec apptainer --silent --quiet exec \
--ipc --no-eval --no-privs --unsquash --userns --uts --pid --cleanenv --env CHECKPOINT_DISABLE=true --env DISABLE_VERSION_CHECK=true \
{{ xdg_dir.libexec_dir }}/terraform.sif terraform "$@"
dest: '{{ xdg_dir.bin_home }}terraform'
dest: '{{ xdg_dir.bin_home }}/terraform'
mode: "755"
name: apptainer | Create terraform-apptainer launch script
name: apptainer | Create terraform environment
@ -86,7 +108,7 @@
exec apptainer --silent --quiet exec \
--ipc --no-eval --no-privs --unsquash --userns --uts --pid --cleanenv --env CHECKPOINT_DISABLE=true --env DISABLE_VERSION_CHECK=true \
{{ xdg_dir.libexec_dir }}/vault.sif vault "$@"
dest: '{{ xdg_dir.bin_home }}vault'
dest: '{{ xdg_dir.bin_home }}/vault'
mode: "755"
name: apptainer | Create vault-apptainer launch script
name: apptainer | Create vault environment
@ -108,7 +130,7 @@
exec apptainer --silent --quiet exec \
--ipc --no-eval --no-privs --unsquash --userns --uts --pid --cleanenv \
{{ xdg_dir.libexec_dir }}/consul.sif consul "$@"
dest: '{{ xdg_dir.bin_home }}consul'
dest: '{{ xdg_dir.bin_home }}/consul'
mode: "755"
name: apptainer | Create consul-apptainer launch script
name: apptainer | Create consul environment
@ -130,7 +152,7 @@
exec apptainer --silent --quiet exec \
--ipc --no-eval --no-privs --unsquash --userns --uts --pid --cleanenv \
{{ xdg_dir.libexec_dir }}/nomad.sif nomad "$@"
dest: '{{ xdg_dir.bin_home }}nomad'
dest: '{{ xdg_dir.bin_home }}/nomad'
mode: "755"
name: apptainer | Create nomad-apptainer launch script
name: apptainer | Create nomad environment

View File

@ -4,7 +4,7 @@ wallpaper_dir: '{{ ansible_user_dir }}/Pictures/Wallpapers'
# Fonts that are not covered by system packages
font_versions:
iosevka: 27.3.4
sarasa-gothic: 0.42.5
sarasa-gothic: 0.42.6
kvantum_themes:
- name: Nordic