guix.yml 1.29 KB
Newer Older
Todor Kondic's avatar
Todor Kondic committed
1
2
3
4
5
- name: Create .config/guix.
  file:
    path: "/home/{{ item['login'] }}/.config/guix"
    state: directory
    recurse: yes
Todor Kondic's avatar
Todor Kondic committed
6
    force: no
Todor Kondic's avatar
Todor Kondic committed
7
8
  become_user: "{{ item['login'] }}"
  loop: "{{ users }}"
Todor Kondic's avatar
Todor Kondic committed
9
  ignore_errors: yes
Todor Kondic's avatar
Todor Kondic committed
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
    

- 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
37
38
  tags: guix-inst-pkg

Todor Kondic's avatar
Todor Kondic committed
39
40
- name: Install packages.
  command:
Todor Kondic's avatar
...    
Todor Kondic committed
41
    cmd: /usr/bin/bash -l -c 'guix package -c4 -m /etc/guix_manifest.scm --fallback'
Todor Kondic's avatar
Todor Kondic committed
42
43
  tags: guix-inst-pkg
  become_user: "{{ item.login }}"
Todor Kondic's avatar
...    
Todor Kondic committed
44
  retries: 20
Todor Kondic's avatar
...    
Todor Kondic committed
45
46
47
  delay: 5
  register: result
  until: result.rc == 0
Todor Kondic's avatar
Todor Kondic committed
48
  loop: "{{ users }}"
49
50

- name: Install guix managed programs.
Todor Kondic's avatar
...    
Todor Kondic committed
51
  tags: guix-copy-bin
52
53
54
  copy:
    src: files/home/user/.local/bin/
    dest: "/home/{{ item.login }}/.local/bin"
Todor Kondic's avatar
...    
Todor Kondic committed
55
56
57
58
    mode: '0744'
    owner: "{{ item.login }}"
    group: "{{ item.login }}"
  loop: "{{ users }}"