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
- txt
- haskell
# containers tool groups
container_tools:
dev:

View file

@ -2,29 +2,25 @@
hosts: localhost
connection: local
vars:
configue:
- bash
- cli
- git
- ssh
- scripts
apps:
- cli
vars_prompt:
- name: tools_in
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:
# link and copy dotfiles
- role: dotfiles
vars:
configue:
- bash
- cli
- git
- ssh
- scripts
# install apps
- role: installs
vars:
apps:
- cli
# install and setup dev tools
- role: dev
vars:
tools: "{{ tools_in.split(',') }}"
# TODO: repositories

View file

@ -1,38 +1,32 @@
- name: Create distrobox containers on host
hosts: localhost
connection: local
vars:
tasks:
- name: Create containers
include_role:
name: dev_host
ansible.builtin.include_role:
name: container
vars:
container_name: '{{ item }}'
loop: '{{ container_names }}'
- name: Setup 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:
# link and copy dotfiles
- role: dotfiles
vars:
configue:
- bash
- cli
- git
- ssh
- scripts
# install apps
- role: installs
vars:
apps:
- cli
# install and setup dev tools
- role: dev
vars:
tools: "{{ container_tools['{{item}}'] }}"
# TODO: repositories

View file

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

View file

@ -6,4 +6,3 @@
- ninja-build
- git
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
ansible.builtin.dnf5:

View file

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

View file

@ -11,15 +11,18 @@
- curl
state: latest
# TODO: use curl script ??
- name: Install bun
ansible.builtin.shell:
cmd: npm install -g bun
ansible.builtin.command:
cmd: npm install -g bun
changed_when: true # change is checked inside npm
- name: Get programs list to check fish presence
ansible.builtin.package_facts:
manager: auto
- name: Update fish path
ansible.builtin.shell:
cmd: echo 'fish_add_path {{ ansible_env.HOME }}/.bun/bin'
when: "'fish' in ansible_facts.packages"
- name: Update fish path for bun
ansible.builtin.shell: fish_add_path {{ ansible_env.HOME }}/.bun/bin
args:
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
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"
- ansible.builtin.import_tasks: js.yml
- name: JavaScript dev envronment
ansible.builtin.import_tasks: js.yml
when: "'js' in tools"
- ansible.builtin.import_tasks: haskell.yml
- name: Haskell dev environment
ansible.builtin.import_tasks: haskell.yml
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"
- ansible.builtin.import_tasks: lang.yml
- name: Language development environment
ansible.builtin.import_tasks: lang.yml
when: "'lang' in tools"
# TODO: ocaml, truffle, ...
# TODO: ocaml, truffle, coq ...

View file

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

View file

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

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"
- ansible.builtin.import_tasks: cli.yml
- name: Common cli tools config
ansible.builtin.import_tasks: cli.yml
when: "'cli' in configure"
- ansible.builtin.import_tasks: git.yml
- name: Git config
ansible.builtin.import_tasks: git.yml
when: "'git' in configure"
- ansible.builtin.import_tasks: ssh.yml
- name: Ssh config
ansible.builtin.import_tasks: ssh.yml
when: "'ssh' in configure"
- ansible.builtin.import_tasks: gui.yml
- name: GUI programs config
ansible.builtin.import_tasks: gui.yml
when: "'gui' in configure"
- ansible.builtin.import_tasks: scripts.yml
- name: Script dirs config
ansible.builtin.import_tasks: scripts.yml
when: "'scripts' in configure"
- ansible.builtin.import_tasks: de.yml
- name: Desctop envionment config
ansible.builtin.import_tasks: de.yml
when: "'de' in configure"

View file

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

View file

@ -15,4 +15,3 @@
- qt5-qtvirtualkeyboard
- hunspell-ru
state: latest

View file

@ -7,4 +7,3 @@
- powertop
- ansible
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"
- ansible.builtin.import_tasks: gui.yml
- name: Install common gui apps
ansible.builtin.import_tasks: gui.yml
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"
- ansible.builtin.import_tasks: proxy.yml
- name: Install proxies
ansible.builtin.import_tasks: proxy.yml
when: "'proxy' in apps"

View file

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