numtide / flake-utils

Pure Nix flake utility functions [maintainer=@zimbatm]
MIT License
1.14k stars 78 forks source link

deprecate `mkApp` in favor of direct definitions #103

Open soupglasses opened 1 year ago

soupglasses commented 1 year ago

Now that nixpkgs has its own idea of passthru.exePath under the name meta.mainProgram, deprecate our solution in favor of the new standard.

This subsequently removes the value of which mkApp brings, and therefore a full deprecation for its removal has begun.

Closes: #65

soupglasses commented 1 year ago

That became a few more force pushes than desired, but it should all be good now! :sweat_smile:

zimbatm commented 1 year ago

I forgot; the main use-case for apps is for packages that output multiple binaries. For example mkApp { drv = coreutils; name = "ls"; }.

So I propose to just deprecate any uses of drv.passthru.exePath.

zimbatm commented 1 year ago

ok, that seems ready to me. have a look and tell me what you think.

soupglasses commented 1 year ago

I am honestly still quite a bit for deprecating the entire mkApp still. And recommending the use of { type = "app"; program = "${drv}/bin/name"; } or using packages. with mainProgram instead.

As there is little gain having a mkApp function compared to just using the direct definition it creates. For example:

{
  outputs.apps.x86_64-linux = {
    with-lib = flake-utils.lib.mkApp { drv = pkgs.coreutils; name = "ls"; };
    no-lib = { type = "app"; program = "${pkgs.coreutils}/bin/ls"; };
  };
}