home lab init

This commit is contained in:
plasmagoat 2025-06-03 23:07:46 +02:00
commit 7278922625
65 changed files with 27336 additions and 0 deletions

View file

@ -0,0 +1,13 @@
- name: Install Nix (multi-user mode)
ansible.builtin.shell: |
if [ ! -x /nix/var/nix/profiles/default/bin/nix ]; then
curl -L https://nixos.org/nix/install | bash -s -- --daemon
fi
args:
creates: /nix
- name: Enable flakes in nix config
ansible.builtin.copy:
dest: /etc/nix/nix.conf
content: |
experimental-features = nix-command flakes

View file

@ -0,0 +1,25 @@
- name: Stop nix-daemon service
ansible.builtin.systemd:
name: nix-daemon.service
state: stopped
enabled: no
ignore_errors: yes
- name: Remove /nix directory
ansible.builtin.file:
path: /nix
state: absent
- name: Remove nix entries from root's shell config
ansible.builtin.lineinfile:
path: /root/.bashrc
regexp: "^.*nix.*$"
state: absent
ignore_errors: yes
- name: Remove nix entries from root's shell profile
ansible.builtin.lineinfile:
path: /root/.profile
regexp: "^.*nix.*$"
state: absent
ignore_errors: yes