diff --git a/.agents/Agent.md b/.agents/Agent.md index 95e41c2..191c298 100644 --- a/.agents/Agent.md +++ b/.agents/Agent.md @@ -3,6 +3,12 @@ A complete reference for an AI agent to understand, navigate, and modify this NixOS homelab configuration repository. +> **⚠️ MANDATORY:** Before doing anything in this repository, read +> [`GUIDELINES.md`](../GUIDELINES.md) in full and follow it. It contains +> non-negotiable hard rules (never run builds, never edit `flake.lock`, etc.) +> and requires you to **present a plan and get user approval before making any +> changes**. + --- ## Repository Purpose diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..0cef1a8 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,17 @@ +# Agent Instructions + +**MANDATORY FIRST ACTION:** Read [`GUIDELINES.md`](GUIDELINES.md) in full before +doing anything in this repository. It is the single source of truth for agent +behavior here. + +Key non-negotiable rules from that file: + +- **Always present a plan first** and wait for user approval before making any + changes — no matter how small the task. +- **Never run builds or system switches** (`nixos-rebuild`, `nh os`, `skyg os`, + `nix build`, `nix flake check`, etc.) — zero exceptions, even if asked. +- Never edit `flake.lock`, `*.hardware-configuration.nix`, or anything in + `secrets/`. +- Never add `imports = [...]` to host files. +- Never commit or create branches unless explicitly asked. +- Also read [`.agents/Agent.md`](.agents/Agent.md) for full repository context. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..e4db270 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,17 @@ +# Claude Instructions — nixos-setup + +**MANDATORY FIRST ACTION:** Read [`GUIDELINES.md`](GUIDELINES.md) in full before +doing anything in this repository. It is the single source of truth for agent +behavior here. + +Key non-negotiable rules from that file: + +- **Always present a plan first** and wait for user approval before making any + changes — no matter how small the task. +- **Never run builds or system switches** (`nixos-rebuild`, `nh os`, `skyg os`, + `nix build`, `nix flake check`, etc.) — zero exceptions, even if asked. +- Never edit `flake.lock`, `*.hardware-configuration.nix`, or anything in + `secrets/`. +- Never add `imports = [...]` to host files. +- Never commit or create branches unless explicitly asked. +- Also read [`.agents/Agent.md`](.agents/Agent.md) for full repository context. diff --git a/GUIDELINES.md b/GUIDELINES.md index f5cea97..683ee95 100644 --- a/GUIDELINES.md +++ b/GUIDELINES.md @@ -5,6 +5,20 @@ Read this file before making any changes. --- +## Mandatory First Step — Always Present a Plan + +Before making **any** change to this repository, you MUST present a short plan to the user and wait for their approval. This applies to every task, no matter how small. + +Your plan must include: +1. **What** you intend to change (files, options, packages) +2. **Why** the change is needed +3. **How** you will do it (which files you will edit, in what order) +4. **What you will NOT do** (e.g., "I will not run any builds") + +Only after the user approves the plan may you proceed with edits. + +--- + ## Hard Rules — Never Break These ### ❌ NEVER run builds or system switches — ZERO EXCEPTIONS diff --git a/hosts/hl-fwdesk.nix b/hosts/hl-fwdesk.nix index 956a16d..9a683a1 100644 --- a/hosts/hl-fwdesk.nix +++ b/hosts/hl-fwdesk.nix @@ -226,12 +226,18 @@ in ]; volumes = [ "/var/lib/hermes:/opt/data" + # Expose the host Nix store + daemon so nix works inside the container + "/nix/store:/nix/store:ro" + "/nix/var/nix/daemon-socket:/nix/var/nix/daemon-socket" ]; environmentFiles = [ config.age.secrets.hermes-env.path ]; environment = { PUID = "1000"; PGID = "100"; HERMES_HOME = "/opt/data"; + NIX_REMOTE = "daemon"; + NIX_CONFIG = "experimental-features = nix-command flakes"; + PATH = "${pkgs.nix}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"; }; shm_size = "1g"; extra_hosts = [ "host.docker.internal:host-gateway" ]; diff --git a/modules/nixos/server/services/comfyui/rocm-docker.nix b/modules/nixos/server/services/comfyui/rocm-docker.nix index b425be1..4a52771 100644 --- a/modules/nixos/server/services/comfyui/rocm-docker.nix +++ b/modules/nixos/server/services/comfyui/rocm-docker.nix @@ -156,6 +156,7 @@ in "--group-add=render" "--security-opt=seccomp=unconfined" "--ipc=host" + "--add-host=host.docker.internal:host-gateway" ]; environment = { @@ -177,6 +178,8 @@ in then [ "${cfg.rocm.outputDir}:/workspace/ComfyUI/output" ] else [ "${cfg.rocm.dataDir}/output:/workspace/ComfyUI/output" ]) ++ cfg.rocm.extraVolumes; + + networks = [ "main" ]; }; # Ensure the container service starts after Docker image is built