guix.yml 2.11 KB
Newer Older
Todor Kondic's avatar
Todor Kondic committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
- 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.
  command:
    cmd: /etc/installguix.sh
    creates: /var/guix/profiles/per-user/root/current-guix/bin/guix

- name: Create .config/guix.
  file:
    path: "/home/{{ item['login'] }}/.config/guix"
    state: directory
    recurse: yes
  become_user: "{{ item['login'] }}"
  loop: "{{ users }}"
    

- name: Copy channels.
  copy:
    src: files/home/user/.config/guix/channels.scm
    dest: "/home/{{ item.login }}/.config/guix/channels.scm"
  become_user: "{{ item.login }}"
  loop: "{{ users }}"
    
- name: Guix pull everywhere.
  command:
    cmd: /usr/bin/bash -l -c 'guix pull'
  become_user: "{{ item.login }}"
  loop: "{{ users }}"
  tags: guix-pull



- name: Run guix pull as root.
  tags: guix-pull
  command:
    cmd: guix pull

- name: Copy package manifest.
  copy:
    src: files/etc/guix_manifest.scm
    dest: /etc/guix_manifest.scm
54
55
56
57
58
59
60
  tags: guix-inst-pkg

- name: Copy "new shinyscreen" package manifest.
  copy:
    src: files/etc/guix_new_shinyscreen_manifest.scm
    dest: /etc/guix_new_shinyscreen_manifest.scm
  tags: guix-inst-pkg
Todor Kondic's avatar
Todor Kondic committed
61
62
63

- name: Install packages.
  command:
Todor Kondic's avatar
...    
Todor Kondic committed
64
    cmd: /usr/bin/bash -l -c 'guix package -c4 -m /etc/guix_manifest.scm --fallback'
Todor Kondic's avatar
Todor Kondic committed
65
66
  tags: guix-inst-pkg
  become_user: "{{ item.login }}"
Todor Kondic's avatar
...    
Todor Kondic committed
67
  retries: 20
Todor Kondic's avatar
...    
Todor Kondic committed
68
69
70
  delay: 5
  register: result
  until: result.rc == 0
Todor Kondic's avatar
Todor Kondic committed
71
  loop: "{{ users }}"
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87

- name: Create new shinyscreen profile.
  command:
    cmd: >
      /usr/bin/bash -l -c
      'guix package -c4 
      -m /etc/guix_new_shinyscreen_manifest.scm
      -p "/home/{{ item.login }}/.prof-ss"
      --fallback'
  tags: guix-inst-pkg
  become_user: "{{ item.login }}"
  retries: 20
  delay: 5
  register: result
  until: result.rc == 0
  loop: "{{ users }}"