dotfiles/roles/nix/tasks/configuration.yml

46 lines
1.1 KiB
YAML
Raw Normal View History

---
# 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:
2024-10-15 20:30:18 +02:00
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