Make import from derivation work again

Broken by f503e556ea
Fixes #12

Cause of the problem:
nix-instantiate uses the store in read-only mode by default, unlike
nix-build.
Import from derivation requires a read-write store, causing the
command to fail with a (bad) error message. This only happened when
the derivation wasn't already built. This did not occur often
because commands like arion up use nix-build and therefore typically
mask the problem on subsequent invocations.

To reproduce the problem, garbage collect, then arion ps.
This commit is contained in:
Robert Hensing 2019-01-20 12:24:59 +01:00
parent da7091c37b
commit 313a65c914

View file

@ -138,9 +138,11 @@ done
do_eval() { do_eval() {
echo 1>&2 "Evaluating configuration..." echo 1>&2 "Evaluating configuration..."
# read-write-mode is required for import from derivation
nix-instantiate \ nix-instantiate \
"$nix_dir/eval-docker-compose.nix" \ "$nix_dir/eval-docker-compose.nix" \
--eval \ --eval \
--read-write-mode \
--json \ --json \
--argstr uid "$UID" \ --argstr uid "$UID" \
--arg modules "$modules" \ --arg modules "$modules" \