Skip to content

Commit ed9d66c

Browse files
committed
Add backwards-compatibility packages
1 parent 4ea6d4f commit ed9d66c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

flake.nix

+14
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,17 @@
651651
''
652652
${pkgs.lib.getExe self.packages."${system}".default} test ${./core/stdlib/std.ncl} && mkdir $out
653653
'';
654+
655+
# This flake used to build nickel-lang-cli and nickel-lang-lsp packages with separate
656+
# crane invocations. We switched to building the full workspace for better cargo caching,
657+
# but we also support the old packages for backwards-compatibility.
658+
compatPackage = { nickel-lang, binary, name }: pkgs.runCommand name
659+
{
660+
meta.mainProgram = binary;
661+
} ''
662+
mkdir -p $out/bin
663+
cp -r "${nickel-lang}/bin/${binary}" $out/bin/
664+
'';
654665
in
655666
rec {
656667
packages = {
@@ -659,6 +670,9 @@
659670
benchmarks
660671
cargoArtifacts;
661672
default = packages.nickel-lang;
673+
674+
nickel-lang-cli = compatPackage { inherit (packages) nickel-lang; binary = "nickel"; name = "nickel-lang-cli"; };
675+
nickel-lang-lsp = compatPackage { inherit (packages) nickel-lang; binary = "nls"; name = "nickel-lang-lsp"; };
662676
nickelWasm = buildNickelWasm { };
663677
dockerImage = buildDocker packages.nickel-lang; # TODO: docker image should be a passthru
664678
inherit vscodeExtension;

0 commit comments

Comments
 (0)