Specify use of NIX for dependencies #7
Labels
No labels
bug
duplicate
effort
high
effort
low
effort
medium
effort
minimal
enhancement
help wanted
invalid
pr
feedback
pr
reviewing
question
status
backlog
status
document
status
done
status
implement
status
pending
status
planning
status
reviewing
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tepichord/milner#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Naina:
Updated on 2026-08-18 based on maintainer feedback.
Overview
This issue adopts Nix as the primary dependency manager for the infrastructure repo. We'll create a
flake.nixproviding all CLI tools vianix develop, then update PLAN.md, AGENTS.md, and READMEs to document the new workflow. This replaces the current Homebrew-only setup instructions with a reproducible, lockfile-pinned alternative.Technical Approach
flake.nixwithnixpkgspinned to a commit hash +flake-utils:Generate and commit
flake.lockvianix flake update.Update
AGENTS.md— add to## Tech Stack:Add agent self-detection to
## Code Conventions:PLAN.md— add under## Decided Questions:README.md— replace Homebrew setup with:hc-vault/README.md— replacebrew install podman podman-composeandbrew install mkcert nss:worker/vm-setup/create-worker-vm.shline 137 — replace error message:Implementation Details
Files to create:
flake.nixflake.lockFiles to modify:
PLAN.mdAGENTS.mdREADME.mdcontrol-plane/README.mdbrew install terraformwith Nix referencehc-vault/README.mdbrew install podmanetc. with Nix referenceworker/vm-setup/create-worker-vm.shDependencies: All tools confirmed available in nixpkgs:
terraform,libvirt,qemu,podman,podman-compose,mkcert,talosctl,minikube,tailscale,openssl,curl.Constraints:
libvirtddaemon cannot be managed by Nix — must be running separately. Flake providesvirshCLI only.curlis defensive (already on macOS by default).aarch64-darwin(macOS arm64) —flake-utils.eachDefaultSystemhandles this.Out-of-scope notes:
nix-darwin/home-managernot needed — plaindevShellflake is sufficient..envrc/ direnv — direnv hooks into interactive shell prompts, not filesystem operations. SettingCommand::current_dir()in Rust does not trigger direnv.nix develop(ornix develop --command <tool>) is the only activation mechanism.Acceptance Criteria
flake.nixexists with nixpkgs pinned to a commit hash andnix developenters a shell with terraform, virsh, qemu, podman, podman-compose, mkcert, talosctl, minikube, tailscale, openssl, and curl availableflake.lockis committed and pins a specific nixpkgs revisionPLAN.mddocuments Nix as the dependency management decisionAGENTS.mdreferences Nix in Tech Stack and documentsIN_NIX_SHELLcheck in Code ConventionsREADME.mdinstructs users to install Nix and runnix developcontrol-plane/README.mdandhc-vault/README.mdreference Nix instead of Homebrewworker/vm-setup/create-worker-vm.sherror message referencesnix developTesting Plan
nix develop --command terraform versionto verify terraform is availablenix develop --command virsh --versionto verify libvirt CLI is availablenix develop --command podman --versionto verify podman is availablenix develop --command talosctl version --clientto verify talosctl is availablenix develop --command openssl versionto verify openssl is availableflake.lockexists and contains a pinned nixpkgs revisionRelated Issues/PRs
None — this is a standalone infrastructure improvement.
Prefer pinning to a commit like the following:
nixpkgs.url = "github:NixOS/nixpkgs/0bb7ec54c8483066ec9d7720e780a5caa71f8612";except choose the latest commit available for the unstable branch.Add: openssl to this list
Agent should be able to determine if they need to run nix develop or not. It is likely they will already be running in the nix develop environment but waste cycles running nix develop again.
Thinking about this from the perspective of https://git.gloom.garden/tepichord/personal-noodle-infra, will setting current directory on a Command object in rust activate direnv? Show me unequivocal proof if it does, otherwise, remove the direnv requirement.
Naina:
Good catches on all four points — here's the plan going forward:
Commit pinning: Agreed, will pin to the latest
nixos-unstablecommit hash (e5bdc4a41d4c072fe1e3787eaa0320a384741d44at time of research) instead of a branch name. The flake input will benixpkgs.url = "github:NixOS/nixpkgs/e5bdc4a41d4c072fe1e3787eaa0320a384741d44";.openssl: Will add it to
buildInputs.Agent self-detection: Good point about wasted cycles.
nix developsetsIN_NIX_SHELL=impure, so agents can check[ "${IN_NIX_SHELL:-}" = "impure" ]before re-entering. Will document this in AGENTS.md.direnv: You're right to be skeptical — direnv hooks into the shell's
PROMPT_COMMAND/precmd, not the filesystem. Setting.current_dir()on a RustCommanddoes not trigger direnv activation. It only works in interactive shells with the hook installed. Dropping the.envrcrequirement entirely;nix develop(ornix develop --command <tool>) is the only activation mechanism.