From d8da28c5d80d2976f5a607013b272b960c0fcdbe Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 5 Dec 2022 16:18:40 +0100 Subject: reduce closure size --- default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index bc7afc9..1fddd9f 100644 --- a/default.nix +++ b/default.nix @@ -2,6 +2,16 @@ {pkgs ? import (import ./nix/sources.nix).nixpkgs {}}: let + # get rid of implicit dependency on gcc & ghc + stripLib = drv: pkgs.stdenv.mkDerivation { + name = drv.name + "-without-lib"; + src = drv.outPath; + buildPhase = '' + mkdir -p $out + cp -r $src/bin $out + ''; + phases = [ "buildPhase" ]; + }; defaultcards = pkgs.copyPathToStore ./cards.yaml; drvs = with pkgs; rec { @@ -66,5 +76,5 @@ let }; in with pkgs.lib; rec { client = callPackageWith { inherit server; } drvs.uplcg-client {}; - server = pkgs.haskellPackages.callPackage drvs.uplcg-server {}; + server = stripLib (pkgs.haskellPackages.callPackage drvs.uplcg-server {}); } -- cgit v1.2.3