Compare commits

...

3 Commits

Author SHA1 Message Date
3560f348a7
feat: fix container recreate 2024-12-13 19:38:03 +01:00
a0b65c856d
feat: add options file 2024-12-13 19:34:16 +01:00
393e49c781
chore: update config to lazyvim 14 2024-12-13 19:33:52 +01:00
6 changed files with 27 additions and 46 deletions

@ -26,4 +26,3 @@ COPY --chown=user:user config/nvim/lazyvim.json /home/user/.config/nvim/lazyvim.
# === setup container ===
ENV TZ="Europe/Amsterdam"
VOLUME /home/user/.local /home/user/.cache
CMD ["bash", "-l"]

@ -1,3 +1,4 @@
-- Configure custom keymaps.
local keymap = vim.keymap.set
local delkeymap = vim.keymap.del
local opts = { noremap = true, silent = true }

@ -0,0 +1,12 @@
-- Set some custom options.
local opt = vim.opt
local global = vim.g
-- Set target text width for gww to 60.
opt.tw = 60
-- Use original gruvbox theme.
global.gruvbox_material_foreground = "original"
-- Disable snack animations.
global.snacks_animate = false

@ -1,17 +1,9 @@
-- Configure rose-pine and gruvbox-material colorschemes.
return {
{ "rose-pine/neovim" },
{ "sainnhe/gruvbox-material" },
{
"sainnhe/gruvbox-material",
opts = function()
vim.g.gruvbox_material_foreground = "original"
end,
},
{
-- Set default colorscheme.
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox-material",
},
opts = { colorscheme = "gruvbox-material" },
},
}

@ -19,14 +19,4 @@ return {
inlay_hints = { enabled = false },
},
},
{
"hrsh7th/nvim-cmp",
opts = function(_, opts)
-- Disable autocomplete on enter.
local cmp = require("cmp")
opts.mapping = vim.tbl_deep_extend("force", opts.mapping, {
["<CR>"] = cmp.config.disable,
})
end,
},
}

@ -3,19 +3,14 @@
# enter.sh v1.0; job79 #
# Enter into an existing or new dev container and #
# automatically handle dev container updates. #
# #
# TODO #
# ----------------------------------------------- #
# remove --security-opt label=disable #
# configurable mount directories #
# =============================================== #
set -e
set -eu
log() { printf '\e[%sm%s\e[0m %s\n' "${3:-36}" "${2:-}" "$1"; }
arg() { echo -n " $@"; }
# run_args returns the arguments required for the podman run
# command.
run_args() {
arg() { echo -n " $@"; }
arg "--name $name"
# Disable some security settings to make it possible to
@ -54,31 +49,23 @@ fetch=false
while test $# -gt 0; do
case "$1" in
--image | -i)
shift
image="$1"
;;
--name | -n)
shift
name="$1"
;;
--fetch | -f)
fetch=true
;;
*) log "unknown argument '$1'" 'x' 31 ;;
--image | -i) shift && image="$1" ;;
--fetch | -f) fetch=true ;;
-*) log "unknown argument '$1'" 'x' 31 ;;
*) name="$1" ;;
esac
shift
done
if "$fetch" = true ] || [ "$(podman container inspect "$name" -f {{.State.Running}})" = 'false' ]; then
if [ "$fetch" = true ] || [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true' ]; then
log "fetching updates..."
if [ "$(podman pull -q "$image")" != "$(podman container inspect "$name" -f {{.Image}})" ]; then
log "new container image downloaded" '✓' 32
if [ "$(podman pull -q "$image")" != "$(podman container inspect "$name" -f {{.Image}} 2>&1)" ]; then
log "container image downloaded" '✓' 32
podman container rm -f -t 1 "$name" 1>/dev/null
podman run -it $(run_args) "$image"
exit
podman run -td $(run_args) "$image"
else
log "no updates available" '✓' 32
fi
log "no updates available" '✓' 32
fi
podman start "$name" 1>/dev/null