Stream: haskell-flake

Topic: Single Package Multi Executables


view this post on Zulip Srid (Apr 06 2025 at 07:01):

nix run .#package-name should work, no?

view this post on Zulip Srid (Apr 06 2025 at 07:02):

Ah, different executables. Try nix --accept-flake-config run github:juspay/omnix show <your-flake>. You should see the executables in the apps section.

view this post on Zulip Lemos (Apr 06 2025 at 07:02):

Do you have to add any reference of the other executables in the flake file?

view this post on Zulip Lemos (Apr 06 2025 at 07:02):

I will try that out shortly!

view this post on Zulip Srid (Apr 06 2025 at 07:06):

If you try it out in the haskell-flake example, you can expect the two executables to show up:

image.png

view this post on Zulip Lemos (Apr 06 2025 at 07:06):

That command indeed shows up the correct list of executables for the project

view this post on Zulip Lemos (Apr 06 2025 at 07:07):

But I'm not too sure nix build .#exec-2 works as intended.

view this post on Zulip Srid (Apr 06 2025 at 07:07):

You have to nix run it:

❯ nix run .#ex2
warning: Git tree '/Users/srid/code/haskell-flake' is dirty
Hello, Haskell!

nix build is used for packages not apps

view this post on Zulip Srid (Apr 06 2025 at 07:08):

As you can see from the output of om show in that screenshot above. See the table header.

view this post on Zulip Lemos (Apr 06 2025 at 07:09):

I see my mistake. Does that mean that the flake does not need to reference any executable?

view this post on Zulip Srid (Apr 06 2025 at 07:09):

haskell-flake auto-generates them for you

view this post on Zulip Srid (Apr 06 2025 at 07:09):

apps.ex2 just wraps packages.example

view this post on Zulip Lemos (Apr 06 2025 at 07:10):

I see, I see

view this post on Zulip Srid (Apr 06 2025 at 07:10):

https://github.com/srid/haskell-flake/blob/f2fffebd1bac6b6d64d6eaf1227a27808ef05736/nix/modules/project/outputs.nix#L123-L125

https://github.com/srid/haskell-flake/blob/f2fffebd1bac6b6d64d6eaf1227a27808ef05736/nix/modules/project/outputs.nix#L100

If you are curious of implementation.

${lib.getBin package}/bin/${exe}

view this post on Zulip Lemos (Apr 06 2025 at 07:14):

I think we can put this to solved. My original problem seems to have been addressed and now I just can't run the executables because of different reasons (one of the packages is not passing checkPhase)

view this post on Zulip Lemos (Apr 06 2025 at 07:16):

Thank you very much, both for haskell-flake and helping me with these questions!


Last updated: Apr 26 2025 at 14:15 UTC