Aggiunto supporto per nix, alacritty e kitty.

This commit is contained in:
Emiliano Vavassori 2024-10-01 00:51:46 +02:00
parent 813cf57d54
commit 9017f97a6d
11 changed files with 218 additions and 0 deletions

View file

@ -0,0 +1,2 @@
---
dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.dotfiles"

View file

@ -0,0 +1,17 @@
---
# Configuring the nix installation.
- name: Adding syntaxerrormmm to nix-users
ansible.builtin.user:
name: syntaxerrormmm
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
owner: syntaxerrormmm
group: syntaxerrormmm

View file

@ -0,0 +1,7 @@
---
- name: (arch) Installing nix from package management
community.general.pacman:
name: nix
state: present
update_cache: true
become: true

View file

@ -0,0 +1,9 @@
---
- name: (deb) installing nix from package manager
ansible.builtin.apt:
name:
- nix-bin
- nix-setup-systemd
state: present
update_cache: true
become: true

View file

@ -0,0 +1,18 @@
---
# Generic installation, multiuser
# Needs systemd, no SELinux and sudo
- name: Download nix installation script
ansible.builtin.get_url:
url: https://nixos.org/nix/install
dest: /tmp/nixinstall
mode: "0755"
- name: Running installer
ansible.builtin.shell: /tmp/nixinstall --daemon
become: true
- name: Removing install script
ansible.builtin.file:
path: /tmp/nixinstall
state: absent

21
roles/nix/tasks/main.yml Normal file
View file

@ -0,0 +1,21 @@
---
# Installing and configuring nix.
- name: Installation
ansible.builtin.include_tasks: "install/{{ ansible_os_family | lower }}.yml"
when: ansible_os_family == 'Archlinux' or ansible_os_family == 'Debian'
args:
apply:
tags:
- nix
- nix-install
tags:
- nix
- nix-install
- name: Configuration
ansible.builtin.import_tasks: configuration.yml
when: ansible_os_family == 'Archlinux' or ansible_os_family == 'Debian'
tags:
- nix
- nix-config