tvl-depot/fun/gemma/default.nix
Vincent Ambo aaaadbbcdc chore: Remove //overrides from depot
This mechanism wasn't actually used for anything other than a minor
external compatibility thing for buildGo.nix, which can also be solved
with a function parameter.

This breaks //fun/gemma because it means that the elmPackages used to
build it are no longer reachable from depot. We'll sort this out later.

Change-Id: I1bf2240435e869cdc4e99bdd1a138fdd2e76f96e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2646
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-03-23 23:55:49 +00:00

51 lines
1.4 KiB
Nix

{ depot, ... }:
let
inherit (depot.third_party) cacert iana-etc libredirect stdenv runCommandNoCC writeText;
frontend = stdenv.mkDerivation {
name = "gemma-frontend.html";
src = ./frontend;
buildInputs = [ cacert iana-etc ]; # elmPackages.elm
# The individual Elm packages this requires are not packaged and I
# can't be bothered to do that now, so lets open the escape hatch:
outputHashAlgo = "sha256";
outputHash = "000xhds5bsig3kbi7dhgbv9h7myacf34bqvw7avvz7m5mwnqlqg7";
phases = [ "unpackPhase" "buildPhase" ];
buildPhase = ''
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols \
LD_PRELOAD=${libredirect}/lib/libredirect.so
export SYSTEM_CERTIFICATE_PATH=${cacert}/etc/ssl/certs
mkdir .home && export HOME="$PWD/.home"
elm-make --yes Main.elm --output $out
'';
};
injectFrontend = writeText "gemma-frontend.lisp" ''
(in-package :gemma)
(setq *static-file-location* "${runCommandNoCC "frontend" {} ''
mkdir -p $out
cp ${frontend} $out/index.html
''}/")
'';
in depot.nix.buildLisp.program {
name = "gemma";
deps = with depot.third_party.lisp; [
cl-json
cl-prevalence
hunchentoot
local-time
];
srcs = [
./src/gemma.lisp
injectFrontend
];
# depot does not currently have Gemma's frontend dependencies, thus
# the build is disabled.
} // { meta.ci = false; }