From dc5c2d8db676baf7ad3c1e137d354be190a88985 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Mon, 17 Aug 2026 12:07:03 +0400 Subject: [PATCH] RECAFTOR: updates some apps configs, merges time and locale role into base_system role --- .../deploy_and_set_up_lxc_on_proxmox.yaml | 1 - playbooks/deploy_vm_from_cloud_init.yaml | 1 - roles/base_system/tasks/main.yaml | 2 + .../tasks/set_locale_and_time.yaml | 0 roles/human_admin_user/tasks/main.yaml | 4 +- .../files/nvim_config/lazy-lock.json | 9 +-- .../files/nvim_config/lua/options.lua | 14 +++++ .../nvim_config/lua/plugins/colorscheme.lua | 12 ---- .../nvim_config/lua/plugins/treesitter.lua | 62 ------------------- .../files/ranger_config/rifle.conf | 4 +- 10 files changed, 22 insertions(+), 87 deletions(-) rename roles/{set_locale_and_time => base_system}/tasks/set_locale_and_time.yaml (100%) delete mode 100644 roles/update_configs/files/nvim_config/lua/plugins/treesitter.lua diff --git a/playbooks/deploy_and_set_up_lxc_on_proxmox.yaml b/playbooks/deploy_and_set_up_lxc_on_proxmox.yaml index 8c1f95c..285afd2 100644 --- a/playbooks/deploy_and_set_up_lxc_on_proxmox.yaml +++ b/playbooks/deploy_and_set_up_lxc_on_proxmox.yaml @@ -70,7 +70,6 @@ - ../roles/harden_ssh - ../roles/base_system - ../roles/human_admin_user - - ../roles/set_locale_and_time # Update configs - omz, nvim, ranger and so on. Distribute the last version of those configs - ../roles/update_configs diff --git a/playbooks/deploy_vm_from_cloud_init.yaml b/playbooks/deploy_vm_from_cloud_init.yaml index 77ed744..61b3b8b 100644 --- a/playbooks/deploy_vm_from_cloud_init.yaml +++ b/playbooks/deploy_vm_from_cloud_init.yaml @@ -63,7 +63,6 @@ - ../roles/harden_ssh - ../roles/base_system - ../roles/human_admin_user - - ../roles/set_locale_and_time # Update configs - omz, nvim, ranger and so on. Distribute the last version of those configs - ../roles/update_configs diff --git a/roles/base_system/tasks/main.yaml b/roles/base_system/tasks/main.yaml index 459ff7d..3aff217 100644 --- a/roles/base_system/tasks/main.yaml +++ b/roles/base_system/tasks/main.yaml @@ -5,3 +5,5 @@ - name: Remove unnecessary packages ansible.builtin.include_tasks: remove_packages.yaml +- name: Set locale and time + ansible.builtin.include_tasks: set_locale_and_time.yaml diff --git a/roles/set_locale_and_time/tasks/set_locale_and_time.yaml b/roles/base_system/tasks/set_locale_and_time.yaml similarity index 100% rename from roles/set_locale_and_time/tasks/set_locale_and_time.yaml rename to roles/base_system/tasks/set_locale_and_time.yaml diff --git a/roles/human_admin_user/tasks/main.yaml b/roles/human_admin_user/tasks/main.yaml index 19b5b29..fdb55ae 100644 --- a/roles/human_admin_user/tasks/main.yaml +++ b/roles/human_admin_user/tasks/main.yaml @@ -24,13 +24,11 @@ mode: u=rwx,g=r,o-rwx # WARNING: UNPRIVILEGED USER (not ansible) COMMANDS -# Since the golden image contains installed zsh, this step may not be necessary - name: Install oh my zsh remote_user: max - become: false ansible.builtin.command: /home/max/install_omz.sh changed_when: true - failed_when: false + vars: - name: Configure oh my zsh, by pushing the config file remote_user: ansible diff --git a/roles/update_configs/files/nvim_config/lazy-lock.json b/roles/update_configs/files/nvim_config/lazy-lock.json index a7378c8..0fa60e2 100644 --- a/roles/update_configs/files/nvim_config/lazy-lock.json +++ b/roles/update_configs/files/nvim_config/lazy-lock.json @@ -5,17 +5,14 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, "dial.nvim": { "branch": "master", "commit": "f2634758455cfa52a8acea6f142dcd6271a1bf57" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, - "hererocks": { "branch": "master", "commit": "204ab1ff8b68cb7db7c9bafb4be2abf7d22f864e" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" }, - "neorg": { "branch": "main", "commit": "d4dd8979c1129b5251d5565164f54d1cc258e92a" }, - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "neorg": { "branch": "main", "commit": "6fda795b0108c92840fd32db6d5dd54e7f997fa8" }, + "nui.nvim": { "branch": "main", "commit": "a25dd472316d806eb38a5dd667c2e40da5570c75" }, "nvim-cmp": { "branch": "main", "commit": "2ffe79f1f021def8dd1fcd81deb16f1bb0d989f3" }, "nvim-nio": { "branch": "master", "commit": "edcc181a875301dd21840189aa2f2f9ad69fc172" }, - "nvim-treesitter": { "branch": "main", "commit": "c9f9ed6c1892f629ea399f4ee7905f2686fa13f2" }, - "nvim-ts-autotag": { "branch": "main", "commit": "88c1453db4ba7dd24131086fe51fdf74e587d275" }, "nvim-web-devicons": { "branch": "master", "commit": "2ae6958df7ced50baac5035cec0c15799eedfbf7" }, - "pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" }, + "pathlib.nvim": { "branch": "main", "commit": "a0d3dbbe00ce6a546426b1aed3838a82fe6bfc42" }, "tree-sitter-norg": { "branch": "main", "commit": "d7edfaf89198aab652c7a1f0f818196efedaccfb" }, "tree-sitter-norg-meta": { "branch": "main", "commit": "729d4e54fb881ba0ddf0f925ec78401354c7c6db" }, "treesj": { "branch": "main", "commit": "79aedb401bbdc7e4202f7881eab5f6feb2105b0a" }, diff --git a/roles/update_configs/files/nvim_config/lua/options.lua b/roles/update_configs/files/nvim_config/lua/options.lua index fa75fb6..a24fe11 100644 --- a/roles/update_configs/files/nvim_config/lua/options.lua +++ b/roles/update_configs/files/nvim_config/lua/options.lua @@ -1,4 +1,18 @@ vim.opt.clipboard = 'unnamedplus' -- use system clipboard +-- Define the OSC52 clipboard provider +vim.g.clipboard = { + name = "OSC52", + copy = { + ["+"] = require("vim.ui.clipboard.osc52").copy("+"), + ["*"] = require("vim.ui.clipboard.osc52").copy("*"), + }, + paste = { + ["+"] = require("vim.ui.clipboard.osc52").paste("+"), + ["*"] = require("vim.ui.clipboard.osc52").paste("*"), + }, +} + + vim.opt.completeopt = {'menu', 'menuone', 'noselect'} -- Tab diff --git a/roles/update_configs/files/nvim_config/lua/plugins/colorscheme.lua b/roles/update_configs/files/nvim_config/lua/plugins/colorscheme.lua index 62183d5..b549fc7 100644 --- a/roles/update_configs/files/nvim_config/lua/plugins/colorscheme.lua +++ b/roles/update_configs/files/nvim_config/lua/plugins/colorscheme.lua @@ -16,18 +16,6 @@ return { -- With lazy the plugin will be automatically loaded when it is required somewhere { "folke/which-key.nvim", lazy = true }, - { - "nvim-neorg/neorg", - -- lazy-load on filetype - ft = "norg", - -- options for neorg. This will automatically call `require("neorg").setup(opts)` - opts = { - load = { - ["core.defaults"] = {}, - }, - }, - }, - { "dstein64/vim-startuptime", -- lazy-load on a command diff --git a/roles/update_configs/files/nvim_config/lua/plugins/treesitter.lua b/roles/update_configs/files/nvim_config/lua/plugins/treesitter.lua deleted file mode 100644 index 679caca..0000000 --- a/roles/update_configs/files/nvim_config/lua/plugins/treesitter.lua +++ /dev/null @@ -1,62 +0,0 @@ ---- ~/nvim/lua/slydragonn/plugins/treesiter.lua - -return { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPre", "BufNewFile" }, - build = ":TSUpdate", - dependencies = { - "windwp/nvim-ts-autotag", - }, - config = function() - local treesitter = require("nvim-treesitter.config") - - treesitter.setup({ - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - indent = { enable = true }, - autotag = { - enable = true, - }, - ensure_installed = { - "json", - "javascript", - "typescript", - "tsx", - "yaml", - "html", - "css", - "markdown", - "markdown_inline", - "bash", - "lua", - "vim", - "dockerfile", - "gitignore", - "c", - "rust", - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "", - }, - }, - rainbow = { - enable = true, - disable = { "html" }, - extended_mode = false, - max_file_lines = nil, - }, - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - }) - end, -} - diff --git a/roles/update_configs/files/ranger_config/rifle.conf b/roles/update_configs/files/ranger_config/rifle.conf index 5b33524..3f5ec6d 100644 --- a/roles/update_configs/files/ranger_config/rifle.conf +++ b/roles/update_configs/files/ranger_config/rifle.conf @@ -87,8 +87,8 @@ ext x?html?, has w3m, terminal = w3m "$@" # Define the "editor" for text files as first action mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@" mime ^text, label pager = "$PAGER" -- "$@" -!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@" -!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" +!mime ^text, label editor, ext yml|yaml|xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@" +!mime ^text, label pager, ext yml|yaml|xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" ext 1 = man "$1" ext s[wmf]c, has zsnes, X = zsnes "$1"