feat(users/Profpatsch/importDhall): print dhall command
It’s often not obvious what dhall command to run to (type)-check the dhall files directly without the nix roundtrip. Now we just print the command, easy to copy. Change-Id: I704a647bff13f73d5a1b1d33b00a46bcb1a9de4e Reviewed-on: https://cl.tvl.fyi/c/depot/+/5528 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
12869cda7d
commit
9dac448466
1 changed files with 8 additions and 4 deletions
|
@ -24,15 +24,13 @@ let
|
|||
type ? null
|
||||
}:
|
||||
let
|
||||
absRoot = path: toString root + "/" + path;
|
||||
src =
|
||||
depot.users.Profpatsch.exactSource
|
||||
root
|
||||
# exactSource wants nix paths, but I think relative paths
|
||||
# as strings are more intuitive.
|
||||
(
|
||||
let abs = path: toString root + "/" + path;
|
||||
in ([ (abs main) ] ++ (map abs files))
|
||||
);
|
||||
([ (absRoot main) ] ++ (map absRoot files));
|
||||
|
||||
cache = ".cache";
|
||||
cacheDhall = "${cache}/dhall";
|
||||
|
@ -50,6 +48,12 @@ let
|
|||
# go into the source directory, so that the type can import files.
|
||||
# TODO: This is a bit of a hack hrm.
|
||||
cd "${src}"
|
||||
printf 'Generating dhall nix code. Run
|
||||
%s --file %s
|
||||
to reproduce
|
||||
' \
|
||||
${pkgs.dhall}/bin/dhall \
|
||||
${absRoot main}
|
||||
${if hadTypeAnnot then ''
|
||||
printf '%s' ${lib.escapeShellArg "${src}/${main} ${typeAnnot}"} \
|
||||
| ${pkgs.dhall-nix}/bin/dhall-to-nix \
|
||||
|
|
Loading…
Reference in a new issue