Skip to content

Commit

Permalink
[feat] add compression
Browse files Browse the repository at this point in the history
  • Loading branch information
MangoIV committed Jun 15, 2024
1 parent 5765959 commit 7c873ca
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions nix/static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
hlib = pkgsStatic.haskell.lib.compose;
hspkgs = pkgsStatic.haskellPackages.override {
overrides =
pkgs.lib.composeExtensions (import ./haskell-overlay.nix {inherit hlib;})
pkgs.lib.composeExtensions
(import ./haskell-overlay.nix {inherit hlib;})
(_hself: hsuper: {
cabal-install =
hlib.overrideCabal {
Expand All @@ -25,4 +26,15 @@
});
};
in
hlib.justStaticExecutables hspkgs.cabal-audit
(hlib.justStaticExecutables hspkgs.cabal-audit).overrideAttrs (old: {
postPhases = ["compressionPhase"];
nativeBuildInputs =
old.nativeBuildInputs
++ [
pkgsStatic.upx
];
compressionPhase = ''
echo "this might take a while.."
upx --quiet --best $out/bin/cabal-audit
'';
})

0 comments on commit 7c873ca

Please sign in to comment.