fixes with linter

This commit is contained in:
ProgramSnail 2025-08-09 11:47:58 +03:00
parent 932046cc39
commit 66109effc5
20 changed files with 124 additions and 111 deletions

View file

@ -3,7 +3,6 @@ container_names:
- dev - dev
- txt - txt
- haskell - haskell
# containers tool groups # containers tool groups
container_tools: container_tools:
dev: dev:

View file

@ -2,29 +2,25 @@
hosts: localhost hosts: localhost
connection: local connection: local
vars: vars:
configue:
- bash
- cli
- git
- ssh
- scripts
apps:
- cli
vars_prompt: vars_prompt:
- name: tools_in - name: tools_in
prompt: "Specify comma separated list of required tool packages (cpp, js, haskell, txt, lang)" prompt: "Specify comma separated list of required tool packages (cpp, js, haskell, txt, lang)"
pre_tasks:
- name: Get tools list
ansible.builtin.set_fact:
tools: "{{ tools_in.split(',') }}"
roles: roles:
# link and copy dotfiles # link and copy dotfiles
- role: dotfiles - role: dotfiles
vars:
configue:
- bash
- cli
- git
- ssh
- scripts
# install apps # install apps
- role: installs - role: installs
vars:
apps:
- cli
# install and setup dev tools # install and setup dev tools
- role: dev - role: dev
vars:
tools: "{{ tools_in.split(',') }}"
# TODO: repositories

View file

@ -1,38 +1,32 @@
- name: Create distrobox containers on host - name: Create distrobox containers on host
hosts: localhost hosts: localhost
connection: local connection: local
vars:
tasks: tasks:
- name: Create containers - name: Create containers
include_role: ansible.builtin.include_role:
name: dev_host name: container
vars: vars:
container_name: '{{ item }}' container_name: '{{ item }}'
loop: '{{ container_names }}' loop: '{{ container_names }}'
- name: Setup containers - name: Setup containers
hosts: containers hosts: containers
vars:
configue:
- bash
- cli
- git
- ssh
- scripts
apps:
- cli
pre_tasks:
- name: Get tools list
ansible.builtin.set_fact:
tools: "{{ tools_in.split(',') }}"
roles: roles:
# link and copy dotfiles # link and copy dotfiles
- role: dotfiles - role: dotfiles
vars:
configue:
- bash
- cli
- git
- ssh
- scripts
# install apps # install apps
- role: installs - role: installs
vars:
apps:
- cli
# install and setup dev tools # install and setup dev tools
- role: dev - role: dev
vars:
tools: "{{ container_tools['{{item}}'] }}"
# TODO: repositories

View file

@ -3,7 +3,7 @@
- name: Check if container already exists - name: Check if container already exists
containers.podman.podman_container_info: containers.podman.podman_container_info:
name: '{{ container_name }}' name: '{{ container_name }}'
register: container_info register: container_info
- name: Create container using distrobox - name: Create container using distrobox
ansible.builtin.command: ansible.builtin.command:
@ -23,9 +23,9 @@
cmd: 'distrobox enter --name {{ container_name }} -- sh -c ''exit''' cmd: 'distrobox enter --name {{ container_name }} -- sh -c ''exit'''
# start if not running or if not defined # start if not running or if not defined
when: not (container_info.containers[0].State.Running | default(false)) when: not (container_info.containers[0].State.Running | default(false))
changed_when: true # ??
- name: Add container to host - name: Add container to host
changed_when: no
ansible.builtin.add_host: ansible.builtin.add_host:
name: '{{ container_name }}' # ?? name: '{{ container_name }}' # ??
groups: containers groups: containers
@ -33,5 +33,4 @@
ansible_host: '{{ container_name }}' ansible_host: '{{ container_name }}'
ansible_user: '{{ ansible_user_id }}' ansible_user: '{{ ansible_user_id }}'
fedora_version: '{{ container_image_tag }}' # ?? fedora_version: '{{ container_image_tag }}' # ??
changed_when: false # ??
# container setup is done outside (?)

View file

@ -6,4 +6,3 @@
- ninja-build - ninja-build
- git - git
state: latest state: latest

View file

@ -1,4 +1,6 @@
- ansible.builtin.import_tasks: build.yml # is done at the main
# - name: Install build comon deps
# ansible.builtin.import_tasks: build.yml
- name: Install tools for cpp dev - name: Install tools for cpp dev
ansible.builtin.dnf5: ansible.builtin.dnf5:
@ -6,7 +8,7 @@
- make - make
- cmake - cmake
- xmake - xmake
- clang - clang
- clang-tools - clang-tools
- clang-tools-extra - clang-tools-extra
@ -14,7 +16,7 @@
- clang-tools-devel - clang-tools-devel
- clang-tools-extra-devel - clang-tools-extra-devel
- clang-libs - clang-libs
- doxygen - doxygen
state: latest state: latest

View file

@ -1,19 +1,25 @@
- name: Download ghcup bootstrap script - name: Download ghcup bootstrap script
ansible.builtin.uri: ansible.builtin.uri:
url: url: https://get-ghcup.haskell.org
return_content: yes return_content: true
register: ghcup_bootstrap register: ghcup_bootstrap
- name: Check if .ghcup present
ansible.builtin.stat:
path: '{{ ansible_env.HOME }}/.ghcup'
register: ghcup_dir
# TODO: detect fish install ??
- name: Install ghcup, stack, lsp server - name: Install ghcup, stack, lsp server
ansible.builtin.shell: ansible.builtin.shell: |
cmd: sh SHELL='/usr/bin/fish'
stdin: {{ ghcup_bootstrap.content }} BOOTSTRAP_HASKELL_NONINTERACTIVE=1
environment: BOOTSTRAP_HASKELL_GHC_VERSION=latest
SHELL: /usr/bin/fish # TODO: detect fish install ?? BOOTSTRAP_HASKELL_CABAL_VERSION=latest
BOOTSTRAP_HASKELL_NONINTERACTIVE: 1 BOOTSTRAP_HASKELL_INSTALL_STACK=1
BOOTSTRAP_HASKELL_GHC_VERSION: latest BOOTSTRAP_HASKELL_INSTALL_HLS=1
BOOTSTRAP_HASKELL_CABAL_VERSION: latest BOOTSTRAP_HASKELL_ADJUST_BASHRC=P
BOOTSTRAP_HASKELL_INSTALL_STACK: 1 {{ ghcup_bootstrap.content }}
BOOTSTRAP_HASKELL_INSTALL_HLS: 1 args:
BOOTSTRAP_HASKELL_ADJUST_BASHRC: P executable: /bin/sh
changed_when: not ghcup_dir.stat.exists

View file

@ -11,15 +11,18 @@
- curl - curl
state: latest state: latest
# TODO: use curl script ??
- name: Install bun - name: Install bun
ansible.builtin.shell: ansible.builtin.command:
cmd: npm install -g bun cmd: npm install -g bun
changed_when: true # change is checked inside npm
- name: Get programs list to check fish presence - name: Get programs list to check fish presence
ansible.builtin.package_facts: ansible.builtin.package_facts:
manager: auto manager: auto
- name: Update fish path - name: Update fish path for bun
ansible.builtin.shell: ansible.builtin.shell: fish_add_path {{ ansible_env.HOME }}/.bun/bin
cmd: echo 'fish_add_path {{ ansible_env.HOME }}/.bun/bin' args:
when: "'fish' in ansible_facts.packages" executable: /usr/bin/fish
changed_when: true # change is checked inside fish_add_path

View file

@ -1,4 +1,5 @@
- ansible.builtin.import_tasks: cpp.yml - name: Install c++ build tools
ansible.builtin.import_tasks: cpp.yml
- name: Install tools for lang dev - name: Install tools for lang dev
ansible.builtin.dnf5: ansible.builtin.dnf5:

View file

@ -1,18 +1,24 @@
- ansible.builtin.import_tasks: build.yml - name: Common build utils
ansible.builtin.import_tasks: build.yml
- ansible.builtin.import_tasks: cpp.yml - name: C++ dev environment
ansible.builtin.import_tasks: cpp.yml
when: "'cpp' in tools" when: "'cpp' in tools"
- ansible.builtin.import_tasks: js.yml - name: JavaScript dev envronment
ansible.builtin.import_tasks: js.yml
when: "'js' in tools" when: "'js' in tools"
- ansible.builtin.import_tasks: haskell.yml - name: Haskell dev environment
ansible.builtin.import_tasks: haskell.yml
when: "'haskell' in tools" when: "'haskell' in tools"
- ansible.builtin.import_tasks: txt.yml - name: Text writing (typst) environment
ansible.builtin.import_tasks: txt.yml
when: "'txt' in tools" when: "'txt' in tools"
- ansible.builtin.import_tasks: lang.yml - name: Language development environment
ansible.builtin.import_tasks: lang.yml
when: "'lang' in tools" when: "'lang' in tools"
# TODO: ocaml, truffle, ... # TODO: ocaml, truffle, coq ...

View file

@ -3,16 +3,16 @@
user: typst user: typst
repo: typst repo: typst
action: latest_release action: latest_release
register: typst_version register: typst_version
- name: "Installing typst {{ typst_version.tag }}" - name: "Installing typst {{ typst_version.tag }}"
become: true become: true
ansible.builtin.unarchive: ansible.builtin.unarchive:
remote_src: yes remote_src: true
# TODO: insert v before version ?? # TODO: insert v before version ??
src: "https://github.com/typst/typst/releases/download/{{ typst_version.tag }}/typst-x86_64-unknown-linux-musl.tar.xz" src: "https://github.com/typst/typst/releases/download/{{ typst_version.tag }}/typst-x86_64-unknown-linux-musl.tar.xz"
dest: "/usr/bin/" dest: "/usr/bin/"
keep_newer: yes keep_newer: true
mode: a+x mode: a+x
extra_opts: extra_opts:
- --strip=1 - --strip=1
@ -24,17 +24,17 @@
user: Myriad-Dreamin user: Myriad-Dreamin
repo: tinymist repo: tinymist
action: latest_release action: latest_release
register: tinymist_version register: tinymist_version
- name: "Installing tinymist (typst lsp) {{ tinymist_version.tag }}" - name: "Installing tinymist (typst lsp) {{ tinymist_version.tag }}"
become: true become: true
ansible.builtin.unarchive: ansible.builtin.unarchive:
remote_src: yes remote_src: true
# TODO: insert v before version ??, rc ?? # TODO: insert v before version ??, rc ??
src: "https://github.com/Myriad-Dreamin/tinymist/releases/download/{{ tinymist_version.tag }}/tinymist-x86_64-unknown-linux-gnu.tar.gz" src: "https://github.com/Myriad-Dreamin/tinymist/releases/download/{{ tinymist_version.tag }}/tinymist-x86_64-unknown-linux-gnu.tar.gz"
dest: "/usr/bin/" dest: "/usr/bin/"
mode: a+x mode: a+x
keep_newer: yes keep_newer: true
extra_opts: extra_opts:
- --strip=1 - --strip=1
- --no-anchored - --no-anchored
@ -45,17 +45,17 @@
user: blopker user: blopker
repo: codebook repo: codebook
action: latest_release action: latest_release
register: codebook_version register: codebook_version
- name: "Installing codebook (spellcheck lsp) {{ codebook_version.tag }}" - name: "Installing codebook (spellcheck lsp) {{ codebook_version.tag }}"
become: true become: true
ansible.builtin.unarchive: ansible.builtin.unarchive:
remote_src: yes remote_src: true
# TODO: insert v before version ?? # TODO: insert v before version ??
src: "https://github.com/blopker/codebook/releases/download/{{ codebook_version.tag }}/codebook-lsp-x86_64-unknown-linux-musl.tar.gz" src: "https://github.com/blopker/codebook/releases/download/{{ codebook_version.tag }}/codebook-lsp-x86_64-unknown-linux-musl.tar.gz"
dest: "/usr/bin/" dest: "/usr/bin/"
mode: a+x mode: a+x
keep_newer: yes keep_newer: true
extra_opts: extra_opts:
- --strip=1 - --strip=1
- --no-anchored - --no-anchored

View file

@ -1,6 +1,6 @@
# shell # shell
- ansible.builtin.import_tasks: bash.yml - name: Import bash config
ansible.builtin.import_tasks: bash.yml
# copy to modify during install ?? # copy to modify during install ??
- name: Link fish configuration directory - name: Link fish configuration directory
@ -39,6 +39,7 @@
manager: auto manager: auto
- name: Update fish path to include scripts folder - name: Update fish path to include scripts folder
ansible.builtin.shell: ansible.builtin.shell: fish_add_path {{ ansible_env.HOME }}/.bin
cmd: echo 'fish_add_path {{ ansible_env.HOME }}/.bin' args:
when: "'fish' in ansible_facts.packages" executable: /usr/bin/fish
changed_when: true # change is checked inside fish_add_path

View file

@ -11,7 +11,7 @@
dest: '{{ ansible_env.HOME }}/.alacritty.toml' dest: '{{ ansible_env.HOME }}/.alacritty.toml'
state: link state: link
force: true force: true
- name: Link alacritty configuration directory - name: Link alacritty configuration directory
ansible.builtin.file: ansible.builtin.file:
src: '{{ role_path }}/files/.config/alacritty' src: '{{ role_path }}/files/.config/alacritty'

View file

@ -1,21 +1,27 @@
- ansible.builtin.import_tasks: bash.yml - name: Bash config
ansible.builtin.import_tasks: bash.yml
when: "'bash' in configure" when: "'bash' in configure"
- ansible.builtin.import_tasks: cli.yml - name: Common cli tools config
ansible.builtin.import_tasks: cli.yml
when: "'cli' in configure" when: "'cli' in configure"
- ansible.builtin.import_tasks: git.yml - name: Git config
ansible.builtin.import_tasks: git.yml
when: "'git' in configure" when: "'git' in configure"
- ansible.builtin.import_tasks: ssh.yml - name: Ssh config
ansible.builtin.import_tasks: ssh.yml
when: "'ssh' in configure" when: "'ssh' in configure"
- ansible.builtin.import_tasks: gui.yml - name: GUI programs config
ansible.builtin.import_tasks: gui.yml
when: "'gui' in configure" when: "'gui' in configure"
- ansible.builtin.import_tasks: scripts.yml - name: Script dirs config
ansible.builtin.import_tasks: scripts.yml
when: "'scripts' in configure" when: "'scripts' in configure"
- ansible.builtin.import_tasks: de.yml - name: Desctop envionment config
ansible.builtin.import_tasks: de.yml
when: "'de' in configure" when: "'de' in configure"

View file

@ -31,6 +31,7 @@
state: latest state: latest
- name: Clear trash automatically every 30 days - name: Clear trash automatically every 30 days
ansible.builtin.shell: ansible.builtin.cron:
cmd: sh name: "empty trash"
stdin: '(crontab -l ; echo "@daily $(which trash-empty) 30")' special_time: "daily"
job: "$(which trash-empty) 30"

View file

@ -6,7 +6,7 @@
- kitty - kitty
- kitty-fish-integration - kitty-fish-integration
- alacritty - alacritty
- kate - kate
- okular - okular
- gwenview - gwenview
@ -15,4 +15,3 @@
- qt5-qtvirtualkeyboard - qt5-qtvirtualkeyboard
- hunspell-ru - hunspell-ru
state: latest state: latest

View file

@ -7,4 +7,3 @@
- powertop - powertop
- ansible - ansible
state: latest state: latest

View file

@ -1,11 +1,15 @@
- ansible.builtin.import_tasks: cli.yml - name: Install common cli apps
ansible.builtin.import_tasks: cli.yml
when: "'cli' in apps" when: "'cli' in apps"
- ansible.builtin.import_tasks: gui.yml - name: Install common gui apps
ansible.builtin.import_tasks: gui.yml
when: "'gui' in apps" when: "'gui' in apps"
- ansible.builtin.import_tasks: host.yml - name: Install pps for host
ansible.builtin.import_tasks: host.yml
when: "'host' in apps" when: "'host' in apps"
- ansible.builtin.import_tasks: proxy.yml - name: Install proxies
ansible.builtin.import_tasks: proxy.yml
when: "'proxy' in apps" when: "'proxy' in apps"

View file

@ -3,12 +3,11 @@
user: Snawoot user: Snawoot
repo: hola-proxy repo: hola-proxy
action: latest_release action: latest_release
register: hola_version register: hola_version
- name: "Installing hola-proxy {{ hola_version.tag }}" - name: "Installing hola-proxy {{ hola_version.tag }}"
become: true become: true
ansible.builtin.get_url: ansible.builtin.get_url:
remote_src: yes
# TODO: insert v before version ?? # TODO: insert v before version ??
url: "https://github.com/Snawoot/hola-proxy/releases/download/{{ hola_version.tag }}/hola-proxy.linux-amd64" url: "https://github.com/Snawoot/hola-proxy/releases/download/{{ hola_version.tag }}/hola-proxy.linux-amd64"
dest: "/usr/bin/hola-proxy" dest: "/usr/bin/hola-proxy"
@ -20,12 +19,11 @@
user: Snawoot user: Snawoot
repo: opera-proxy repo: opera-proxy
action: latest_release action: latest_release
register: opera_version register: opera_version
- name: "Installing opera-proxy {{ opera_version.tag }}" - name: "Installing opera-proxy {{ opera_version.tag }}"
become: true become: true
ansible.builtin.get_url: ansible.builtin.get_url:
remote_src: yes
# TODO: insert v before version ?? # TODO: insert v before version ??
url: "https://github.com/Snawoot/opera-proxy/releases/download/{{ opera_version.tag }}/hola-proxy.linux-amd64" url: "https://github.com/Snawoot/opera-proxy/releases/download/{{ opera_version.tag }}/hola-proxy.linux-amd64"
dest: "/usr/bin/hola-proxy" dest: "/usr/bin/hola-proxy"