From da553de7b16e0d9a77520d422842361fc52cd167 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 1 Jun 2022 13:38:17 +0200 Subject: [PATCH] Fix template checking --- src/nix/flake.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nix/flake.cc b/src/nix/flake.cc index 70356fca8..2fa779874 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -450,7 +450,9 @@ struct CmdFlakeCheck : FlakeCommand if (auto attr = v.attrs->get(state->symbols.create("path"))) { if (attr->name == state->symbols.create("path")) { PathSet context; - state->coerceToStorePath(attr->pos, *attr->value, context); + auto path = state->coerceToPath(attr->pos, *attr->value, context); + if (!path.pathExists()) + throw Error("template '%s' refers to a non-existent path '%s'", attrPath, path); // TODO: recursively check the flake in 'path'. } } else