on cg@certdir help sign in
obelisk/haskell-overlays/tighten-ob-exes.nix
32 lines 975 B history raw
1self: super:
3let
4 pkgs = self.callPackage ({ pkgs }: pkgs) {};
5 haskellLib = pkgs.haskell.lib;
7 commandRuntimeDeps = with pkgs; [
8 coreutils
9 git
10 nix-prefetch-git
11 openssh
12 ];
13in
16 # Dynamic linking with split objects dramatically increases startup time (about
17 # 0.5 seconds on a decent machine with SSD), so we do `justStaticExecutables`.
18 obelisk-command = haskellLib.overrideCabal
19 (haskellLib.generateOptparseApplicativeCompletion "ob"
20 (haskellLib.justStaticExecutables super.obelisk-command))
21 (drv: {
22 buildTools = (drv.buildTools or []) ++ [ pkgs.buildPackages.makeWrapper ];
23 postFixup = ''
24 ${drv.postFixup or ""}
25 # Make `ob` reference its runtime dependencies.
26 wrapProgram "$out"/bin/ob --prefix PATH : ${pkgs.lib.makeBinPath commandRuntimeDeps}
27 '';
28 passthru = { inherit commandRuntimeDeps; };
29 });
31 obelisk-selftest = haskellLib.justStaticExecutables super.obelisk-selftest;