Open
Description
Describe the bug
derivations in flake templates are not properly evaluated?
Steps To Reproduce
Consider the following code:
{
outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
templatePackage = pkgs.stdenv.mkDerivation {
name = "foo-template-package";
src = ./.;
installPhase = ''
mkdir -p $out
echo yo > $out/foo
'';
};
in
{
templates = {
foo = {
path = "${templatePackage}";
};
};
};
}
Calling nix flake init -t ".#foo"
gives me the following error:
error: opening directory '/nix/store/<some-hash>-foo-template-package': No such file or directory
Expected behavior
The derivation should be actually build so that the path exists.
nix-env --version
output
nix-env (Nix) 2.18.5
Priorities
Add π to issues you find important.