dotfiles/roles/nix/tasks/configuration.yml

46 lines
1.1 KiB
YAML

---
# Configuring the nix installation.
- name: Manipulation over {{ additional_user }}
when: ansible_user_id == 'root'
tags:
- nix
- nix-config
block:
- name: Adding user to nix-users
ansible.builtin.user:
name: "{{ additional_user }}"
groups: nix-users
append: true
become_user: root
become: true
- name: Adding configuration to local user
ansible.builtin.file:
src: "{{ dotfdir }}/nix"
dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/nix"
state: link
become_user: "{{ additional_user }}"
become: true
- name: Manipulation over {{ ansible_user_id }}
when: ansible_user_id != 'root'
tags:
- nix
- nix-config
block:
- name: Adding user to nix-users
ansible.builtin.user:
name: "{{ ansible_user_id }}"
groups: nix-users
append: true
become: true
- name: Adding configuration to local user
ansible.builtin.file:
src: "{{ dotfdir }}/nix"
dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/nix"
state: link