#!/usr/bin/env bash # Shared Nix bootstrap for scripts/codex-setup.sh and # scripts/codex-maintenance.sh: the nix.conf settings both need in effect # before a single `nix` command runs (flakes enabled, never honor a flake # input's own nixConfig, no "dirty tree" warning spam), plus a helper to # pull an already-installed Nix's daemon/profile script onto PATH if it # isn't there yet. Source this instead of copying it -- see CLAUDE.md. export NIX_CONFIG="${NIX_CONFIG:-} experimental-features = nix-command flakes accept-flake-config = false warn-dirty = false " ensure_nix_profile() { if [ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]; then . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh elif [ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then . "$HOME/.nix-profile/etc/profile.d/nix.sh" fi }