danielrolls.nix

nix-install

Galaxy

This is an Ansible role that sets up the nix package manager. Unlike other roles that install a single-user version of nix, this role uses a multi-user installation as recommended in the guide to ensure proper build isolation. It also allows upgrading nix versions by uninstalling the current version first. The role is very simple and easy to customize.

Requirements

This role works with any Linux distribution that uses systemd and has been tested with Ubuntu.

Role Variables

  • nix_version: The version of nix to download and install. If not specified, it will use the latest tested version.
  • installer_checksum: A checksum for the installer binary. Change this if you change the nix version. It's best to let it fail the first time and then use the provided new checksum.
  • nix_commands: An optional list of shell commands to run with nix and its daemon.
  • flakes: Set this to enable nix flake commands.
  • config: Optionally, you can add extra configuration to the nix configuration file.

Example Playbook

This example installs nix for all users on "myhost":

- hosts: myhost
  roles:
    - role: danielrolls.nix

This example installs nix for all users on "myhost" and then runs the command nix-info:

- hosts: myhost
  roles:
    - role: danielrolls.nix
      nix_commands:
      - "nix-shell -p nix-info --command nix-info" 

License

MIT

Author Information

Github Profile

Informazioni sul progetto

Installs the nix package manager with the daemon as recommended.

Installa
ansible-galaxy install danielrolls.nix
Licenza
mit
Download
8.7k
Proprietario