Compare commits
3 Commits
9bed5b823f
...
3560f348a7
Author | SHA1 | Date | |
---|---|---|---|
3560f348a7 | |||
a0b65c856d | |||
393e49c781 |
@@ -26,4 +26,3 @@ COPY --chown=user:user config/nvim/lazyvim.json /home/user/.config/nvim/lazyvim.
|
|||||||
# === setup container ===
|
# === setup container ===
|
||||||
ENV TZ="Europe/Amsterdam"
|
ENV TZ="Europe/Amsterdam"
|
||||||
VOLUME /home/user/.local /home/user/.cache
|
VOLUME /home/user/.local /home/user/.cache
|
||||||
CMD ["bash", "-l"]
|
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
-- Configure custom keymaps.
|
||||||
local keymap = vim.keymap.set
|
local keymap = vim.keymap.set
|
||||||
local delkeymap = vim.keymap.del
|
local delkeymap = vim.keymap.del
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
|
12
config/nvim/config/options.lua
Normal file
12
config/nvim/config/options.lua
Normal file
@@ -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.
|
-- Configure rose-pine and gruvbox-material colorschemes.
|
||||||
return {
|
return {
|
||||||
{ "rose-pine/neovim" },
|
{ "rose-pine/neovim" },
|
||||||
|
{ "sainnhe/gruvbox-material" },
|
||||||
{
|
{
|
||||||
"sainnhe/gruvbox-material",
|
|
||||||
opts = function()
|
|
||||||
vim.g.gruvbox_material_foreground = "original"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
-- Set default colorscheme.
|
|
||||||
"LazyVim/LazyVim",
|
"LazyVim/LazyVim",
|
||||||
opts = {
|
opts = { colorscheme = "gruvbox-material" },
|
||||||
colorscheme = "gruvbox-material",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@@ -19,14 +19,4 @@ return {
|
|||||||
inlay_hints = { enabled = false },
|
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,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
37
enter.sh
37
enter.sh
@@ -3,19 +3,14 @@
|
|||||||
# enter.sh v1.0; job79 #
|
# enter.sh v1.0; job79 #
|
||||||
# Enter into an existing or new dev container and #
|
# Enter into an existing or new dev container and #
|
||||||
# automatically handle dev container updates. #
|
# 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"; }
|
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
|
# run_args returns the arguments required for the podman run
|
||||||
# command.
|
# command.
|
||||||
run_args() {
|
run_args() {
|
||||||
arg() { echo -n " $@"; }
|
|
||||||
arg "--name $name"
|
arg "--name $name"
|
||||||
|
|
||||||
# Disable some security settings to make it possible to
|
# Disable some security settings to make it possible to
|
||||||
@@ -54,31 +49,23 @@ fetch=false
|
|||||||
|
|
||||||
while test $# -gt 0; do
|
while test $# -gt 0; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--image | -i)
|
--image | -i) shift && image="$1" ;;
|
||||||
shift
|
--fetch | -f) fetch=true ;;
|
||||||
image="$1"
|
-*) log "unknown argument '$1'" 'x' 31 ;;
|
||||||
;;
|
*) name="$1" ;;
|
||||||
--name | -n)
|
|
||||||
shift
|
|
||||||
name="$1"
|
|
||||||
;;
|
|
||||||
--fetch | -f)
|
|
||||||
fetch=true
|
|
||||||
;;
|
|
||||||
*) log "unknown argument '$1'" 'x' 31 ;;
|
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
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..."
|
log "fetching updates..."
|
||||||
if [ "$(podman pull -q "$image")" != "$(podman container inspect "$name" -f {{.Image}})" ]; then
|
if [ "$(podman pull -q "$image")" != "$(podman container inspect "$name" -f {{.Image}} 2>&1)" ]; then
|
||||||
log "new container image downloaded" '✓' 32
|
log "container image downloaded" '✓' 32
|
||||||
podman container rm -f -t 1 "$name" 1>/dev/null
|
podman container rm -f -t 1 "$name" 1>/dev/null
|
||||||
podman run -it $(run_args) "$image"
|
podman run -td $(run_args) "$image"
|
||||||
exit
|
else
|
||||||
|
log "no updates available" '✓' 32
|
||||||
fi
|
fi
|
||||||
log "no updates available" '✓' 32
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
podman start "$name" 1>/dev/null
|
podman start "$name" 1>/dev/null
|
||||||
|
Reference in New Issue
Block a user