Skip to content

Commit

Permalink
Always just executables and don't build haddock
Browse files Browse the repository at this point in the history
- Doesn't inflate closure size to over 2GB, see #143
- The API docs aren't important and we're intending on deprecating the
  hackage package, see #161
  • Loading branch information
infinisil committed Mar 14, 2024
1 parent 59c8792 commit 4de3b1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ let
];
};

build = pkgs.haskellPackages.nixfmt;
build = lib.pipe pkgs.haskellPackages.nixfmt [
haskell.lib.justStaticExecutables
haskell.lib.dontHaddock
(drv: lib.lazyDerivation { derivation = drv; })
];
in
build
// rec {
packages = {
nixfmt = build;
nixfmt-static = haskell.lib.justStaticExecutables packages.nixfmt;
nixfmt-deriver = packages.nixfmt-static.cabal2nixDeriver;
nixfmt-deriver = build.cabal2nixDeriver;

nixfmt-shell = packages.nixfmt.env.overrideAttrs (oldAttrs: {
buildInputs =
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

apps.default = {
type = "app";
program = "${self.packages.${system}.nixfmt-static}/bin/nixfmt";
program = "${result}/bin/nixfmt";
};

checks = result.checks;
Expand Down

0 comments on commit 4de3b1b

Please sign in to comment.