1
0

Added Nix

This commit is contained in:
2025-11-03 18:07:10 +01:00
parent b25a30615b
commit a89bfb740e
6 changed files with 26 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
{{- $shell := promptBoolOnce . "features.shell" "Do you want to install the Fish shell" true }} {{- $shell := promptBoolOnce . "features.shell" "Do you want to install the Fish shell" true }}
{{- $git := promptBoolOnce . "features.git" "Do you want to install Git" true }} {{- $git := promptBoolOnce . "features.git" "Do you want to install Git" true }}
{{- $editor := promptBoolOnce . "features.editor" "Do you want to install Neovim" true }} {{- $editor := promptBoolOnce . "features.editor" "Do you want to install Neovim" true }}
{{- $nix := promptBoolOnce . "features.editor" "Do you want to install the Nix package manager" true }}
[data] [data]
email = {{ $email | quote }} email = {{ $email | quote }}
@@ -13,3 +14,4 @@ git_name = {{ $git_name | quote }}
shell = {{ $shell }} shell = {{ $shell }}
git = {{ $git }} git = {{ $git }}
editor = {{ $editor }} editor = {{ $editor }}
nix = {{ $nix }}

View File

@@ -10,3 +10,7 @@
{{- if not .features.editor }} {{- if not .features.editor }}
.config/nvim .config/nvim
{{- end }} {{- end }}
{{- if not .features.nix }}
.config/nix
{{- end }}

View File

@@ -5,3 +5,7 @@ abbr --add --position command l ls -lAh
abbr --add --position command vim nvim abbr --add --position command vim nvim
abbr --add --position command vi nvim abbr --add --position command vi nvim
{{- end }} {{- end }}
{{- if .features.nix }}
abbr --add --position command nd 'nix develop --command $SHELL'
{{- end }}

View File

@@ -0,0 +1,2 @@
# Enable Nix flakes
experimental-features = nix-command flakes

View File

@@ -29,3 +29,5 @@
when: features.git == true when: features.git == true
- role: editor - role: editor
when: features.editor == true when: features.editor == true
- role: nix
when: features.nix == true

View File

@@ -0,0 +1,12 @@
- name: Install Nix on Arch
become: true
ansible.builtin.pacman:
name: nix
when: chezmoi.osRelease.id == "arch"
- name: Start the Nix daemon
become: true
ansible.builtin.systemd_service:
name: nix-daemon
enabled: true
state: started