Commit 309950b3 authored by Todor Kondic's avatar Todor Kondic
Browse files

install-bare-guix.yml: Separate installation from maintenance

parent 9a44912c
# This play removes previous guix installations (not the user profile
# links though) and installs it again.
- hosts: stations
become: True
become_method: sudo
remote_user: adamsmith
vars_files:
- vars/users.yml
- vars/passwords.yml
pre_tasks:
- name: Update repositories
apt: update_cache=yes
changed_when: False
tasks:
- name: Remove traces of previous Guix (`/var/guix').
file:
state: absent
path: /var/guix
- name: Remove stuff in `/gnu'.
shell: /bin/rm -rf /gnu/*
- name: Get the GPG key to authenticate GNU Guix.
ansible.builtin.command:
cmd: sh -c 'wget ''https://sv.gnu.org/people/viewgpg.php?user_id=15145'' -qO - | sudo -i gpg --import - && touch /etc/guix.key.fetched'
creates: /etc/guix.key.fetched
- name: Get guix installer script.
ansible.builtin.get_url:
url: https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh
force: yes
dest: /etc/guix-install.sh
owner: root
group: root
mode: '0744'
- name: Replace between the expressions.
ansible.builtin.replace:
path: /etc/guix-install.sh
after: '_debug.*---.*FUNCNAME.*---.'
before: 'cd ..tmp.path'
regexp: '^(.+)$'
replace: '# \1'
- name: Replace between the expressions.
ansible.builtin.replace:
path: /etc/guix-install.sh
regexp: '.*cd.*.tmp_path.'
replace: 'cd "$tmp_path"'
- name: Replace between the expressions.
ansible.builtin.replace:
path: /etc/guix-install.sh
regexp: 'mv ...tmp_path..gnu. .'
replace: 'mv "${tmp_path}/gnu/"* /gnu/'
# - name: Run the guix install script.
# shell: yes | /etc/guix-install.sh
# args:
# warn: no
# creates: /var/guix/profiles/per-user/root/current-guix/bin/guix
- name: Get the GPG key to authenticate GNU Guix.
ansible.builtin.command:
cmd: sh -c 'wget ''https://sv.gnu.org/people/viewgpg.php?user_id=15145'' -qO - | sudo -i gpg --import - && touch /etc/guix.key.fetched'
creates: /etc/guix.key.fetched
- name: Copy the guix install script.
ansible.builtin.copy:
src: files/etc/installguix.sh
dest: /etc/installguix.sh
owner: root
group: root
mode: '0744'
- name: Run the guix install script.
shell: yes | /etc/installguix.sh
args:
warn: no
creates: /var/guix/profiles/per-user/root/current-guix/bin/guix
- name: Create .config/guix.
file:
path: "/home/{{ item['login'] }}/.config/guix"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment