Bind mount output of `runCommand` (and other questions of a more general nature)

  1. buildCommand is a string passed to runCommand
    runCommand "endlessh" {} ''mkdir "$out"; tar --directory="$out" --extract --file="${endlesshImage}"''
  2. There is no such thing as “evaulated above” in nix :wink: , they are all evaluated on demand.
    1. Something wants evaluate ``fileSystems.“/var/lib/machines/endlessh”`
      • if no one need it, evaluantion “stops” here, and nothing else will be evaluated.
    2. It requires ${endlessTree} to be evaluated
    3. It requires ${endlesshImage} to be evaluated
      • If you add ${cfg.imageDigest} in your image build, it will evaluate before,
    4. It build your image
  3. No clue :slight_smile:
  4. Yes, but if you left no reference to the previous steps, when you run nix store gc, others will be collected.