From dfe6b7fe40628cfc12ce6f4da8ec042872208778 Mon Sep 17 00:00:00 2001 From: aleidk Date: Mon, 12 Jan 2026 14:55:20 -0300 Subject: [PATCH] update dots management --- .dotter/global.toml | 8 ++- Hooks/containers/post_reload_daemons.sh | 3 - bootstrap/bootstrap.sh | 29 --------- bootstrap/bootstrap.yaml | 69 --------------------- bootstrap/variables.yaml | 81 ------------------------- configs/fish/functions/dots.fish | 3 + .justfile => configs/just/arch.just | 4 +- configs/just/dots.just | 4 ++ configs/just/justfile | 2 + 9 files changed, 16 insertions(+), 187 deletions(-) delete mode 100755 Hooks/containers/post_reload_daemons.sh delete mode 100755 bootstrap/bootstrap.sh delete mode 100644 bootstrap/bootstrap.yaml delete mode 100644 bootstrap/variables.yaml create mode 100644 configs/fish/functions/dots.fish rename .justfile => configs/just/arch.just (95%) create mode 100644 configs/just/dots.just create mode 100644 configs/just/justfile diff --git a/.dotter/global.toml b/.dotter/global.toml index 8170728..0a0d981 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -7,9 +7,11 @@ depends = [ "cli-utils" ] [default.files] - "configs/containers" = "~/.config/containers" - "configs/mpv" = "~/.config/mpv" - "configs/swappy" = "~/.config/swappy" + "configs/containers" = "~/.config/containers" + "configs/just" = "~/.config/just" + "configs/just/dots.just" = { target = "~/.config/just/dots.just", type = "template" } + "configs/mpv" = "~/.config/mpv" + "configs/swappy" = "~/.config/swappy" [default.variables] diff --git a/Hooks/containers/post_reload_daemons.sh b/Hooks/containers/post_reload_daemons.sh deleted file mode 100755 index ff88b1b..0000000 --- a/Hooks/containers/post_reload_daemons.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -systemctl --user daemon-reload diff --git a/bootstrap/bootstrap.sh b/bootstrap/bootstrap.sh deleted file mode 100755 index d9eb29d..0000000 --- a/bootstrap/bootstrap.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -set -eou pipefail - -export ANSIBLE_STDOUT_CALLBACK=minimal - -if ! command -v uv >/dev/null 2>&1; then - echo -e "Installing UV...\n" - curl -LsSf https://astral.sh/uv/install.sh | sh -fi - -echo -e "Executing playbook...\n" - -if [[ -d ~/.config/dotfiles ]]; then - pushd ~/.config/dotfiles/bootstrap/ || exit - - # dotfiles are cloned, executed localy - uvx --from ansible ansible-playbook --ask-become-pass bootstrap.yaml - -else - - # dotfiles are not cloned, executed remotly - uvx --from ansible ansible-pull --ask-become-pass --url ssh://git@git.alecodes.page:24062/alecodes/dots.git bootstrap/bootstrap.yaml - -fi - -popd || exit - -echo -e "Done!\n" diff --git a/bootstrap/bootstrap.yaml b/bootstrap/bootstrap.yaml deleted file mode 100644 index 88211b3..0000000 --- a/bootstrap/bootstrap.yaml +++ /dev/null @@ -1,69 +0,0 @@ -- name: Bootstrap system installation - hosts: localhost - vars_files: - - ./variables.yaml - tasks: - - name: Fedora setup - when: ansible_facts['distribution'] == "Fedora" - block: - - name: Enable copr repos - become: true - loop: "{{ distros.fedora.copr }}" - community.general.copr: - state: enabled - name: "{{ item }}" - - - name: Install packages - become: true - ansible.builtin.package: - state: present - name: "{{ distros.Global.packages }}" - - - name: 'Ensure rustup is setup' - ansible.builtin.command: "{{ (ansible_facts['pkg_mgr'] in ['dnf5']) | ternary('rustup-init -y --no-modify-path', 'rustup --no-modify-path -y') }}" - args: - creates: ~/.cargo/env - - - name: "Installing Cargo Binstall" - ansible.builtin.unarchive: - remote_src: true - src: https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz - dest: "{{ ansible_env.HOME }}/.cargo/bin/" - keep_newer: true - extra_opts: - - "--no-anchored" - - "cargo-binstall" - - - - name: 'Install cargo packages' - loop: "{{ distros[ansible_facts['distribution']].cargo }}" - register: cargo_log - notify: - - Deploy dots - - Install yazi packages - ansible.builtin.command: - cmd: "cargo binstall --no-confirm --locked {{ item.pkg }}" - creates: "{{ ansible_env.HOME }}/.cargo/bin/{{ item.bin }}" - - - name: Generate an OpenSSH keypair - community.crypto.openssh_keypair: - path: ~/.ssh/id_ed25519 - type: ed25519 - - - name: Clone dotfiles - ignore_errors: true - notify: - - Deploy dots - - Install yazi packages - ansible.builtin.git: - accept_newhostkey: true - repo: ssh://git@git.alecodes.page:24062/alecodes/dots.git - dest: ~/.config/dotfiles - update: true - version: main - - handlers: - - name: Deploy dots - ansible.builtin.command: tuckr add * - - name: Install yazi packages - ansible.builtin.command: ya pkg install diff --git a/bootstrap/variables.yaml b/bootstrap/variables.yaml deleted file mode 100644 index 6e8d0df..0000000 --- a/bootstrap/variables.yaml +++ /dev/null @@ -1,81 +0,0 @@ -distros: - Fedora: - copr: - - atim/lazygit - - the4runner/firefox-dev - packages: {} - cargo: - - pkg: yazi-fm - bin: yazi - - pkg: yazi-cli - bin: yazi - - pkg: tuckr - bin: tuckr - - Arch: - packages: - - tuckr-git - cargo: {} - - Global: - packages: - - adwaita-cursor-theme - - adwaita-icon-theme - - adwaita-icon-theme-legacy - - adwaita-mono-fonts - - adwaita-sans-fonts - - bat - - breeze-icon-theme - - breeze-icon-theme-fedora - - curl - - duf - - eza - - fd-find - - firefox-dev - - fish - - flatpak - - fzf - - git - - grim - - kitty - - lazygit - - neovim - - nodejs - - openssh - - openssh-askpass - - openssh-clients - - openssh-server - - openssl - - openssl-devel - - openssl-libs - - php-cli - - php-common - - php-intl - - php-mbstring - - php-pecl-zip - - php-process - - php-soap - - php-xml - - rhythmbox - - ripgrep - - rofi-themes - - rofi-wayland - - rofimoji - - rootfiles - - rsync - - rustup - - sd - - sed - - sushi - - swappy - - tailscale - - tealdeer - - trash-cli - - tree - - tree-sitter-cli - - udisks2 - - unrar - - unrar-free - - unzip - - zip - - zoxide diff --git a/configs/fish/functions/dots.fish b/configs/fish/functions/dots.fish new file mode 100644 index 0000000..9ec4e4f --- /dev/null +++ b/configs/fish/functions/dots.fish @@ -0,0 +1,3 @@ +function dots --wraps='just -g' --description 'alias dots just -g' + just -g $argv +end diff --git a/.justfile b/configs/just/arch.just similarity index 95% rename from .justfile rename to configs/just/arch.just index af46a10..1445d2b 100644 --- a/.justfile +++ b/configs/just/arch.just @@ -3,10 +3,10 @@ packages_file := quote(justfile_directory() / "bootstrap/pkgs_arch.txt") bootstrap: setup_pacman setup_paru install_packages -install_packages: update_packages +install_packages: update paru -S --needed --noconfirm - < {{ packages_file }} -update_packages: +update: paru -Syu --noconfirm clean_orphans: diff --git a/configs/just/dots.just b/configs/just/dots.just new file mode 100644 index 0000000..9ca0f26 --- /dev/null +++ b/configs/just/dots.just @@ -0,0 +1,4 @@ +set working-directory := "{{ dotter.current_dir }}" + +deploy: + dotter deploy diff --git a/configs/just/justfile b/configs/just/justfile new file mode 100644 index 0000000..885aceb --- /dev/null +++ b/configs/just/justfile @@ -0,0 +1,2 @@ +mod dots +mod arch