From 859f26de7ba32ab86cafd90ba18de105a2b3a72d Mon Sep 17 00:00:00 2001 From: lstmnemodel Date: Thu, 21 May 2026 22:51:14 +0300 Subject: [PATCH] v2 --- nnm/Containerfile | 5 +- nnm/config/kitty/kitty.conf | 43 ++++++++------- nnm/config/nvim/init.lua | 40 +++++++++++++- nnm/config/nvim/lua/plugins/colorscheme.lua | 60 +++++++++++++++++++++ nnm/config/nvim/lua/plugins/undotree.lua | 8 +++ nnm/config/zsh/.zshrc | 8 ++- nnm/install.sh | 5 +- nnm/nnm | 2 +- 8 files changed, 144 insertions(+), 27 deletions(-) create mode 100644 nnm/config/nvim/lua/plugins/colorscheme.lua create mode 100644 nnm/config/nvim/lua/plugins/undotree.lua diff --git a/nnm/Containerfile b/nnm/Containerfile index 107cd3f..ec31170 100644 --- a/nnm/Containerfile +++ b/nnm/Containerfile @@ -5,9 +5,12 @@ ARG ALA_DATE COPY pacman.conf /etc/pacman.conf COPY packages.list /tmp/packages.list -COPY config/ /usr/share/nnm/config/ RUN sed "s|\$ala_date|$ALA_DATE|g" -i /etc/pacman.conf && \ pacman -Syu --noconfirm && \ pacman -S --noconfirm $(grep -v '^#' /tmp/packages.list | grep -v '^$') && \ rm -f /tmp/packages.list + +COPY config/ /usr/share/nnm/config/ + +RUN git clone --depth=1 --single-branch https://github.com/ohmyzsh/ohmyzsh.git /usr/share/ohmyzsh diff --git a/nnm/config/kitty/kitty.conf b/nnm/config/kitty/kitty.conf index 73d1539..0932b5f 100644 --- a/nnm/config/kitty/kitty.conf +++ b/nnm/config/kitty/kitty.conf @@ -7,26 +7,29 @@ window_padding_width 6 hide_window_decorations no background_opacity 0.97 -foreground #c0caf5 -background #1a1b26 -selection_foreground #1a1b26 -selection_background #c0caf5 -color0 #15161e -color1 #f7768e -color2 #9ece6a -color3 #e0af68 -color4 #7aa2f7 -color5 #bb9af7 -color6 #7dcfff -color7 #a9b1d6 -color8 #414868 -color9 #f7768e -color10 #9ece6a -color11 #e0af68 -color12 #7aa2f7 -color13 #bb9af7 -color14 #7dcfff -color15 #c0caf5 +background #001e26 +foreground #9bc1c2 +cursor #f34a00 +selection_background #003747 +color0 #002731 +color8 #006388 +color1 #d01b24 +color9 #f4153b +color2 #6bbe6c +color10 #50ee84 +color3 #a57705 +color11 #b17e28 +color4 #2075c7 +color12 #178dc7 +color5 #c61b6e +color13 #e14d8e +color6 #259185 +color14 #00b29e +color7 #e9e2cb +color15 #fcf4dc +selection_foreground #001e26 + +mouse_hide_wait -3.0 map ctrl+grave send_text all \x1b[96;5u diff --git a/nnm/config/nvim/init.lua b/nnm/config/nvim/init.lua index 080c0a6..3e0f3c4 100644 --- a/nnm/config/nvim/init.lua +++ b/nnm/config/nvim/init.lua @@ -1,2 +1,38 @@ -vim.opt.number = true -vim.notify("nnm nvim (stub config)") +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = { + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + { import = "plugins" }, + }, + defaults = { + lazy = false, + version = false, + }, + install = { colorscheme = { "tokyonight" } }, + checker = { enabled = true }, + performance = { + cache = { enabled = true }, + rtp = { + disabled_plugins = { + "gzip", "matchit", "matchparen", + "netrwPlugin", "tarPlugin", "tohtml", + "tutor", "zipPlugin", + }, + }, + }, +}) diff --git a/nnm/config/nvim/lua/plugins/colorscheme.lua b/nnm/config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..5db01f2 --- /dev/null +++ b/nnm/config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,60 @@ +return { + { + "LazyVim/LazyVim", + opts = { + colorscheme = "tokyonight", + }, + }, + { + "folke/tokyonight.nvim", + opts = { + style = "night", + on_highlights = function(hl, c) + hl.Normal = { bg = "#001e26", fg = "#9bc1c2" } + hl.NormalFloat = { bg = "#002731" } + hl.LineNr = { fg = "#006388" } + hl.CursorLine = { bg = "#002731" } + hl.CursorLineNr = { fg = "#9bc1c2" } + hl.Visual = { bg = "#003747" } + hl.VisualNOS = { bg = "#003747" } + hl.Search = { bg = "#a57705", fg = "#001e26" } + hl.IncSearch = { bg = "#f34a00", fg = "#001e26" } + hl.Comment = { fg = "#006388", italic = true } + hl.String = { fg = "#6bbe6c" } + hl.Function = { fg = "#2075c7" } + hl.Number = { fg = "#c61b6e" } + hl.Boolean = { fg = "#c61b6e" } + hl.Type = { fg = "#259185" } + hl.Keyword = { fg = "#d01b24" } + hl.Identifier = { fg = "#9bc1c2" } + hl.Constant = { fg = "#a57705" } + hl.Special = { fg = "#e14d8e" } + hl.Title = { fg = "#178dc7", bold = true } + hl.Todo = { bg = "#a57705", fg = "#001e26" } + hl.Error = { fg = "#f4153b" } + hl.WarningMsg = { fg = "#b17e28" } + hl.MoreMsg = { fg = "#50ee84" } + hl.Question = { fg = "#178dc7" } + hl.Pmenu = { bg = "#002731", fg = "#9bc1c2" } + hl.PmenuSel = { bg = "#003747", fg = "#e9e2cb" } + hl.PmenuSbar = { bg = "#002731" } + hl.PmenuThumb = { bg = "#006388" } + hl.StatusLine = { bg = "#003747", fg = "#9bc1c2" } + hl.StatusLineNC = { bg = "#002731", fg = "#006388" } + hl.TabLine = { bg = "#002731", fg = "#006388" } + hl.TabLineSel = { bg = "#003747", fg = "#e9e2cb" } + hl.TabLineFill = { bg = "#001e26" } + hl.NonText = { fg = "#006388" } + hl.SpecialKey = { fg = "#00b29e" } + hl.MatchParen = { bg = "#003747", fg = "#f34a00" } + hl.DiffAdd = { bg = "#1a3a1a", fg = "#50ee84" } + hl.DiffChange = { bg = "#1a2a3a", fg = "#178dc7" } + hl.DiffDelete = { bg = "#3a1a1a", fg = "#f4153b" } + hl.DiffText = { bg = "#1a3a3a", fg = "#00b29e" } + hl.SpellBad = { undercurl = true, sp = "#f4153b" } + hl.SpellCap = { undercurl = true, sp = "#b17e28" } + hl.Whitespace = { fg = "#004455" } + end, + }, + }, +} diff --git a/nnm/config/nvim/lua/plugins/undotree.lua b/nnm/config/nvim/lua/plugins/undotree.lua new file mode 100644 index 0000000..3ebc390 --- /dev/null +++ b/nnm/config/nvim/lua/plugins/undotree.lua @@ -0,0 +1,8 @@ +return { + { + "mbbill/undotree", + keys = { + { "u", vim.cmd.UndotreeToggle, desc = "Undotree" }, + }, + }, +} diff --git a/nnm/config/zsh/.zshrc b/nnm/config/zsh/.zshrc index b2fcddf..1ce89e6 100644 --- a/nnm/config/zsh/.zshrc +++ b/nnm/config/zsh/.zshrc @@ -1 +1,7 @@ -PROMPT='%F{green}nnm%f %F{blue}%~%f %# ' +ZSH=/usr/share/ohmyzsh +ZSH_THEME=agnoster +source $ZSH/oh-my-zsh.sh + +export TERM=xterm-256color + +prompt_context() { prompt_segment magenta black "%n" } diff --git a/nnm/install.sh b/nnm/install.sh index b1bb627..fc91390 100755 --- a/nnm/install.sh +++ b/nnm/install.sh @@ -10,7 +10,7 @@ CONTAINER="nnm" ALA_DATE="$(grep '^ala_date' "$SCRIPT_DIR/manifest.toml" | sed 's/.*"\(.*\)"/\1/')" BASE_DIGEST="$(grep '^base_image_digest' "$SCRIPT_DIR/manifest.toml" | sed 's/.*"\(.*\)"/\1/')" -TAG_INPUT="$(cat "$SCRIPT_DIR/packages.list" "$SCRIPT_DIR/manifest.toml")" +TAG_INPUT="$(find "$SCRIPT_DIR/config" "$SCRIPT_DIR/Containerfile" -type f | sort | xargs -d'\n' sha256sum; cat "$SCRIPT_DIR/packages.list" "$SCRIPT_DIR/manifest.toml")" IMAGE_TAG="nnm:$(echo -n "$TAG_INPUT" | sha256sum | cut -c1-16)" IMAGE="localhost/$IMAGE_TAG" @@ -32,7 +32,8 @@ if ! distrobox list 2>/dev/null | grep -qw "$CONTAINER"; then [[ -d /dev/nvidia0 ]] && NVIDIA_FLAG="--nvidia" distrobox create --name "$CONTAINER" --image "$IMAGE" $NVIDIA_FLAG else - echo "==> Container '$CONTAINER' already exists." + echo "==> Upgrading container..." + distrobox upgrade "$CONTAINER" fi echo "==> Installing /usr/local/bin/nnm..." diff --git a/nnm/nnm b/nnm/nnm index 2312274..54a1c28 100755 --- a/nnm/nnm +++ b/nnm/nnm @@ -31,7 +31,7 @@ ENVEOF kitty --class="nnm" \ --config "$CONFIG_DIR/kitty/kitty.conf" \ --directory "$PWD" \ - zsh /tmp/nnm-kitty.log & disown ;; esac