Skip to content

multiple packages for multiple executables? #378

Answered by shivaraj-bh
peterbecich asked this question in Q&A
Discussion options

You must be logged in to vote

nix build .#foo works, nix build .#bar should fail. But both nix run .#foo and nix run .#bar should run.

Why?

Flake outputs’ packages exported by haskell-flake comes from package output of the function (See 1 and 2):

buildPackageInfo = name: value: rec {
package = finalPackages.${name};
exes =
lib.listToAttrs
(map
(exe:
lib.nameValuePair exe ({
program = "${lib.getBin package}/bin/${exe}";
meta.description =
if lib.hasAttrByPath [ "meta" "description" ] package
then "${if exe != name then "[${exe}] " else ""}${package.meta.description}"
else "Executable

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@srid
Comment options

srid Nov 25, 2024
Maintainer

@peterbecich
Comment options

Answer selected by peterbecich
Comment options

You must be logged in to vote
1 reply
@peterbecich
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants