Compare commits

..

No commits in common. "66109effc5b8bef84d741129ea68de57565a042d" and "94111b0a4b52d80863875a43bb61f02483a9a69e" have entirely different histories.

20 changed files with 111 additions and 125 deletions

View file

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

View file

@ -1,6 +1,13 @@
- name: Configure distrobox dev container - name: Configure distrobox dev container
hosts: localhost hosts: localhost
connection: local 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: vars:
configue: configue:
- bash - bash
@ -8,19 +15,16 @@
- git - git
- ssh - ssh
- scripts - 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
# 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,15 +1,20 @@
- 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
ansible.builtin.include_role: include_role:
name: container name: dev_host
vars: vars:
container_name: '{{ item }}' container_name: '{{ item }}'
loop: '{{ container_names }}' loop: '{{ container_names }}'
- name: Setup containers - name: Setup containers
hosts: containers hosts: containers
roles:
# link and copy dotfiles
- role: dotfiles
vars: vars:
configue: configue:
- bash - bash
@ -17,16 +22,17 @@
- git - git
- ssh - ssh
- scripts - scripts
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 # 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

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

View file

@ -1,6 +1,4 @@
# is done at the main - ansible.builtin.import_tasks: build.yml
# - 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:

View file

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

View file

@ -11,18 +11,15 @@
- curl - curl
state: latest state: latest
# TODO: use curl script ??
- name: Install bun - name: Install bun
ansible.builtin.command: ansible.builtin.shell:
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 for bun - name: Update fish path
ansible.builtin.shell: fish_add_path {{ ansible_env.HOME }}/.bun/bin ansible.builtin.shell:
args: cmd: echo 'fish_add_path {{ ansible_env.HOME }}/.bun/bin'
executable: /usr/bin/fish when: "'fish' in ansible_facts.packages"
changed_when: true # change is checked inside fish_add_path

View file

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

View file

@ -8,11 +8,11 @@
- name: "Installing typst {{ typst_version.tag }}" - name: "Installing typst {{ typst_version.tag }}"
become: true become: true
ansible.builtin.unarchive: ansible.builtin.unarchive:
remote_src: true remote_src: yes
# 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: true keep_newer: yes
mode: a+x mode: a+x
extra_opts: extra_opts:
- --strip=1 - --strip=1
@ -29,12 +29,12 @@
- 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: true remote_src: yes
# 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: true keep_newer: yes
extra_opts: extra_opts:
- --strip=1 - --strip=1
- --no-anchored - --no-anchored
@ -50,12 +50,12 @@
- 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: true remote_src: yes
# 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: true keep_newer: yes
extra_opts: extra_opts:
- --strip=1 - --strip=1
- --no-anchored - --no-anchored

View file

@ -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,4 +33,5 @@
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

@ -1,6 +1,6 @@
# shell # shell
- name: Import bash config - ansible.builtin.import_tasks: bash.yml
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,7 +39,6 @@
manager: auto manager: auto
- name: Update fish path to include scripts folder - name: Update fish path to include scripts folder
ansible.builtin.shell: fish_add_path {{ ansible_env.HOME }}/.bin ansible.builtin.shell:
args: cmd: echo 'fish_add_path {{ ansible_env.HOME }}/.bin'
executable: /usr/bin/fish when: "'fish' in ansible_facts.packages"
changed_when: true # change is checked inside fish_add_path

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,4 @@
- name: Install c++ build tools - ansible.builtin.import_tasks: cpp.yml
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,15 +1,11 @@
- name: Install common cli apps - ansible.builtin.import_tasks: cli.yml
ansible.builtin.import_tasks: cli.yml
when: "'cli' in apps" when: "'cli' in apps"
- name: Install common gui apps - ansible.builtin.import_tasks: gui.yml
ansible.builtin.import_tasks: gui.yml
when: "'gui' in apps" when: "'gui' in apps"
- name: Install pps for host - ansible.builtin.import_tasks: host.yml
ansible.builtin.import_tasks: host.yml
when: "'host' in apps" when: "'host' in apps"
- name: Install proxies - ansible.builtin.import_tasks: proxy.yml
ansible.builtin.import_tasks: proxy.yml
when: "'proxy' in apps" when: "'proxy' in apps"

View file

@ -8,6 +8,7 @@
- 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"
@ -24,6 +25,7 @@
- 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"