~evhan/beaker

90581f099d55f9b88d80b80b16dfe05d9f309163 — Evan Hanson 1 year, 11 months ago 3cfdbdb
Condense offline defaults file generation and remove leftover dir when running "nix develop"
1 files changed, 6 insertions(+), 10 deletions(-)

M default.nix
M default.nix => default.nix +6 -10
@@ 35,7 35,6 @@ in rec {
    eggCache ? src,
    buildInputs ? [],
    shellHook ? "",
    preUnpack ? "",
    ...
  } @ args:
  let


@@ 48,13 47,14 @@ in rec {
      export CHICKEN_REPOSITORY_PATH=$TMPDIR/build/${repositoryPath}:$CHICKEN_REPOSITORY_PATH
      export CHICKEN_INCLUDE_PATH=$TMPDIR/build/share:$CHICKEN_INCLUDE_PATH
    '';
    offlineDefaults = writeText "setup.defaults" ''
    offlineChickenInstall = writeShellScriptBin "chicken-install" ''
      test -d $TMPDIR/eggs || cp -R -L ${eggCache} $TMPDIR/eggs
      test -f $TMPDIR/setup.defaults || cat > $TMPDIR/setup.defaults <<EOF
      (version 2)
      (location "../.eggs")
      (location "$TMPDIR/eggs")
      (map (srfi-4 ->))
    '';
    offlineChickenInstall = writeShellScriptBin "chicken-install" ''
      exec ${chicken}/bin/chicken-install -defaults ${offlineDefaults} "$@"
      EOF
      exec ${chicken}/bin/chicken-install -defaults $TMPDIR/setup.defaults "$@"
    '';
  in stdenv.mkDerivation (args // {
    inherit name setupEnvironmentPhase;


@@ 75,10 75,6 @@ in rec {
      source $TMPDIR/.env
    '';

    preUnpack = preUnpack + ''
      cp -R -L ${eggCache} .eggs
    '';

    buildPhase = ''
      runHook preBuild