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 dfe157e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ jobs:
run: nix shell .#packages.x86_64-linux.reuse -c reuse lint

- name: build nixfmt
run: nix build -L .#nixfmt-static
run: nix build -L .
if: success() || failure()
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 dfe157e

Please sign in to comment.