exe: Use getBin instead of justStaticExecutables (#151)

This commit is contained in:
Sridhar Ratnakumar 2023-04-27 12:57:56 -04:00 committed by GitHub
parent 1ca25ec71f
commit 11ab35533a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -6,6 +6,7 @@
- #138: Add `checks` to `outputs` submodule - #138: Add `checks` to `outputs` submodule
- #143: Changed `autoWire` to be an enum type, for granular controlling of which outputs to autowire. - #143: Changed `autoWire` to be an enum type, for granular controlling of which outputs to autowire.
- #137: Expose cabal executables as flake apps. Add a corresponding `outputs.apps` option, while the `outputs.localPackages` option is renamed to `outputs.packages` (it now contains package metadata, including packages and its executables). - #137: Expose cabal executables as flake apps. Add a corresponding `outputs.apps` option, while the `outputs.localPackages` option is renamed to `outputs.packages` (it now contains package metadata, including packages and its executables).
- #151: Use `lib.getBin` to get the bin output
- #148: Remove automatic hpack->cabal generation. Use `pre-commit-hooks.nix` instead. - #148: Remove automatic hpack->cabal generation. Use `pre-commit-hooks.nix` instead.
- #149: Fix unnecessary re-runs of cabal2nix evaluation. Add a `debug` option to have haskell-flake produce diagnostic messages. - #149: Fix unnecessary re-runs of cabal2nix evaluation. Add a `debug` option to have haskell-flake produce diagnostic messages.

View File

@ -176,8 +176,9 @@ in
description = '' description = ''
Attrset of executables from `.cabal` file. Attrset of executables from `.cabal` file.
The executables are accessed without any reference to the If the associated Haskell project has a separate bin output
Haskell library, using `justStaticExecutables`. (cf. `enableSeparateBinOutput`), then this exes will refer
only to the bin output.
NOTE: Evaluating up to this option will involve IFD. NOTE: Evaluating up to this option will involve IFD.
''; '';

View File

@ -72,13 +72,12 @@ in
exes = exes =
let let
exeNames = haskell-parsers.getCabalExecutables value.root; exeNames = haskell-parsers.getCabalExecutables value.root;
staticPackage = pkgs.haskell.lib.justStaticExecutables finalPackages.${name};
in in
lib.listToAttrs lib.listToAttrs
(map (map
(exe: (exe:
lib.nameValuePair exe { lib.nameValuePair exe {
program = "${staticPackage}/bin/${exe}"; program = "${lib.getBin finalPackages.${name}}/bin/${exe}";
} }
) )
exeNames exeNames