Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielrolls/nix-install
An Ansible role to install the Nix package manager
https://github.com/danielrolls/nix-install
ansible ansible-role nix
Last synced: about 1 month ago
JSON representation
An Ansible role to install the Nix package manager
- Host: GitHub
- URL: https://github.com/danielrolls/nix-install
- Owner: danielrolls
- License: mit
- Created: 2022-08-29T15:05:13.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-03T14:17:32.000Z (about 2 months ago)
- Last Synced: 2024-11-03T15:19:13.267Z (about 2 months ago)
- Topics: ansible, ansible-role, nix
- Homepage:
- Size: 57.6 KB
- Stars: 29
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
nix-install
=========[![Galaxy](https://img.shields.io/badge/galaxy-danielrolls.nix-blue.svg?style=flat-square)](https://galaxy.ansible.com/danielrolls/nix/)
This is an Ansible role that installs the [nix](https://nixos.org/) package manager.
At the time of writing, all other roles I've seen that install nix, install a single user nix.
This role invokes the multi-user installation as recommended by the manual to ensure build isolation.
The role supports upgrading nix versions for which nix is uninstalled to allow the installer to work.
This role is also extremely simple and hence easy to adapt.Requirements
------------This should work with any Linux distribution that uses systemd.
It has been tested with Ubuntu.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.
config -- Optionally pass addition config to be added to the nix configuration file
Example Playbook
----------------This example installs nix for all users on myhost
```yaml
- hosts: myhost
roles:
- role: danielrolls.nix
```This example also installs nix for all users on myhost and then installs and runs nix-info.
See the [NixOS homepage](https://nixos.org/) for examples of commands to run.
```yaml
- hosts: myhost
roles:
- role: danielrolls.nix
nix_commands:
- "nix-shell -p nix-info --command nix-info"
```License
-------MIT
Author Information
------------------[Github Profile](https://github.com/danielrolls)