Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ Role Variables
nix_version -- The version of nix to download and install.
If unset this role will take the latest nix version it has been tested with.

installer_checksum -- A checksum for the installer binary.
You will need to change this if you change the nix version that is downloaded.
It's easiest to let this fail and fix the error since the error is clear and provides the new checksum value to copy in.

nix_commands -- Optional list of shell commands to run in an environment with nix and the running nix daemon.

flakes -- Set to enable nix flake commands.
Expand Down
1 change: 0 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
nix_version: 2.31.1
installer_checksum: sha256:75f18f5d567bb8c7b5d62155f8c852e62ffac0c81acda02f52b998281e3603ce
flakes: false
nix_commands: []
remove_nix_directory: true
7 changes: 6 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@
when: nix_version_output.rc == 0
- name: Download and run installer
block:
- name: Fetch checksum
ansible.builtin.uri:
url: "{{ installer_path }}.sha256"
return_content: yes
register: checksum_file
- name: Download installer
get_url:
url: "{{ installer_path }}"
dest: /tmp
checksum: "{{ installer_checksum }}"
checksum: "sha256:{{ checksum_file.content }}"
- name: extract installer
unarchive:
src: /tmp/{{ nix_build }}.tar.xz
Expand Down
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
nix_build: nix-{{ nix_version }}-x86_64-linux
nix_build: nix-{{ nix_version }}-{{ ansible_architecture }}-linux
installer_path: https://releases.nixos.org/nix/nix-{{ nix_version }}/{{ nix_build }}.tar.xz