From b1821b5fe798eab0159b9f12d24f2f0f020b29c5 Mon Sep 17 00:00:00 2001 From: earnest ma Date: Sun, 30 Jan 2022 18:02:11 -0500 Subject: [PATCH] Nix task Closes #3 --- roles/common/tasks/main.yml | 1 + roles/common/tasks/nix.yml | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 roles/common/tasks/nix.yml diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index bab22e9..9058af4 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -2,3 +2,4 @@ - include: selinux.yml - include: packages.yml - include: users.yml +- include: nix.yml diff --git a/roles/common/tasks/nix.yml b/roles/common/tasks/nix.yml new file mode 100644 index 0000000..f030014 --- /dev/null +++ b/roles/common/tasks/nix.yml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021 Ableton AG +# SPDX-License-Identifier: MIT +--- +- name: Ensure nix directory exists + become: true + file: + path: "/nix" + owner: "earne" + state: directory + mode: "0755" + register: nix_directory + +- name: Install nix + block: + - name: Download installer script + get_url: + url: "https://nixos.org/nix/install" + dest: "/tmp/install_nix.sh" + mode: "0755" + + - name: Run installer script + become: true + become_user: "earne" + command: "/tmp/install_nix.sh" + when: nix_directory is changed