Files
computer-playbook/roles/dev-nix
kevinveenbirkenbachandClaude Opus 5 7bc12e55f3 fix(docs): drop the generated sections the designer merge put back
aceb5295ef moved Cosmos, Quick Setup and Credits out of the committed role
READMEs and into the documentation build's own scratch checkout, so a
committed copy can no longer go stale when the metadata moves. Merging
feature/designer (ebad39422c) took origin/main's side of those files, which
still carries them, and reinstated all 290 along with the cosmos make target
and its i8cos alias. tests/lint/ansible/roles/test_readme.py hard-fails on a
committed copy, and the reinstated Credits block credited one person with two
URLs, which tripped the credits-attribution lint as well.

Stripped with the repository's own fence-aware parser against
MANAGED_SECTIONS, not with a line filter: the Cosmos block holds a mermaid
fence a naive filter would cut through. The result is byte-identical to
aceb5295ef for every README that carries no prose change since.

The cosmos target wrote the forbidden section straight back into the
checkout, so it goes with them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-06 01:50:43 +02:00
..
…
…
…

dev-nix

This role installs the Nix package manager in a secure, reproducible, and idempotent way across multiple Linux distributions.

Description

The role installs Nix using either the native package manager (where supported and reliable) or the official installer with SHA256 verification.

On platforms where distro packages are known to be problematic (e.g. Arch Linux ARM), the role deliberately avoids the system package and falls back to the official installer to ensure a working and up-to-date Nix installation.

Overview

This role installs the Nix package manager via pacman on Arch x86_64 or via the official installer with SHA256 verification.

Installation Strategy

The role automatically selects the appropriate installation method:

  • Arch Linux (x86_64)
    Installs nix via the system package manager (pacman).

  • All other platforms (including Arch Linux ARM, Debian, Ubuntu, Fedora, EL, Generic Linux)
    Uses the official Nix installer in multi-user (daemon) mode.

This avoids ABI and SONAME mismatches on rolling or less frequently rebuilt distributions.

Security Model

The official installer is downloaded at runtime and verified before execution:

  • The installer script is fetched from the official release location
  • Its SHA256 checksum is fetched from the same release
  • The checksum is validated before execution
  • Installation aborts immediately if verification fails

No unverified code is executed on the target system.

Features

  • Automatic platform detection (Arch x86_64 vs others)
  • Verified official installer with SHA256 checksum validation
  • Multi-user (daemon) installation mode
  • Optional shell integration via /etc/profile.d
  • Optional activation of experimental features (nix-command, flakes)
  • Fully idempotent (safe to run multiple times)
  • Distro-agnostic fallback logic

Configuration Options

Key variables (see defaults/main.yml):

  • dev_nix_installer_version
    Nix version to install via the official installer.

  • dev_nix_enable_experimental_features
    Enable experimental features such as nix-command and flakes.

  • dev_nix_enable_shell_snippet
    Whether to install a profile snippet for automatic environment loading.

Notes on Offline Usage

This role does not ship the installer script and therefore requires network access during installation.

If a fully offline or air-gapped setup is required, the role can be extended to use a locally vendored installer script with a pinned checksum.

Further Resources