mirror of
https://codeberg.org/ProgramSnail/config.git
synced 2025-12-16 20:38:43 +00:00
fixes with linter
This commit is contained in:
parent
932046cc39
commit
66109effc5
20 changed files with 124 additions and 111 deletions
|
|
@ -3,7 +3,6 @@ container_names:
|
|||
- dev
|
||||
- txt
|
||||
- haskell
|
||||
|
||||
# containers tool groups
|
||||
container_tools:
|
||||
dev:
|
||||
|
|
|
|||
|
|
@ -1,13 +1,6 @@
|
|||
- name: Configure distrobox dev container
|
||||
hosts: localhost
|
||||
connection: local
|
||||
vars:
|
||||
vars_prompt:
|
||||
- name: tools_in
|
||||
prompt: "Specify comma separated list of required tool packages (cpp, js, haskell, txt, lang)"
|
||||
roles:
|
||||
# link and copy dotfiles
|
||||
- role: dotfiles
|
||||
vars:
|
||||
configue:
|
||||
- bash
|
||||
|
|
@ -15,16 +8,19 @@
|
|||
- git
|
||||
- ssh
|
||||
- scripts
|
||||
|
||||
# install apps
|
||||
- role: installs
|
||||
vars:
|
||||
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
|
||||
# install apps
|
||||
- role: installs
|
||||
# install and setup dev tools
|
||||
- role: dev
|
||||
vars:
|
||||
tools: "{{ tools_in.split(',') }}"
|
||||
|
||||
# TODO: repositories
|
||||
|
|
|
|||
|
|
@ -1,20 +1,15 @@
|
|||
- 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
|
||||
roles:
|
||||
# link and copy dotfiles
|
||||
- role: dotfiles
|
||||
vars:
|
||||
configue:
|
||||
- bash
|
||||
|
|
@ -22,17 +17,16 @@
|
|||
- git
|
||||
- ssh
|
||||
- scripts
|
||||
|
||||
# install apps
|
||||
- role: installs
|
||||
vars:
|
||||
apps:
|
||||
- cli
|
||||
|
||||
pre_tasks:
|
||||
- name: Get tools list
|
||||
ansible.builtin.set_fact:
|
||||
tools: "{{ tools_in.split(',') }}"
|
||||
roles:
|
||||
# link and copy dotfiles
|
||||
- role: dotfiles
|
||||
# install apps
|
||||
- role: installs
|
||||
# install and setup dev tools
|
||||
- role: dev
|
||||
vars:
|
||||
tools: "{{ container_tools['{{item}}'] }}"
|
||||
|
||||
# TODO: repositories
|
||||
|
||||
|
|
|
|||
|
|
@ -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 # ??
|
||||
|
|
@ -6,4 +6,3 @@
|
|||
- ninja-build
|
||||
- git
|
||||
state: latest
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -11,15 +11,18 @@
|
|||
- curl
|
||||
state: latest
|
||||
|
||||
# TODO: use curl script ??
|
||||
- name: Install bun
|
||||
ansible.builtin.shell:
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
@ -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 ...
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@
|
|||
- 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
|
||||
|
|
@ -29,12 +29,12 @@
|
|||
- 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
|
||||
|
|
@ -50,12 +50,12 @@
|
|||
- 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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -15,4 +15,3 @@
|
|||
- qt5-qtvirtualkeyboard
|
||||
- hunspell-ru
|
||||
state: latest
|
||||
|
||||
|
|
|
|||
|
|
@ -7,4 +7,3 @@
|
|||
- powertop
|
||||
- ansible
|
||||
state: latest
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
- 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"
|
||||
|
|
@ -25,7 +24,6 @@
|
|||
- 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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue