mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-09-11 06:55:40 +03:00
Set meta.mainProgram for executable components (#1539)
- This allows nix run to work correctly, so that it knows the correct name of the executable, as it would otherwise attempt to execute an executable named "project-name-exe-exeName", for example. - See #1231.
This commit is contained in:
parent
278367ad80
commit
5d5d471409
@ -356,6 +356,14 @@ let
|
||||
description = package.synopsis or "";
|
||||
license = haskellLib.cabalToNixpkgsLicense package.license;
|
||||
platforms = if platforms == null then lib.platforms.all else platforms;
|
||||
} // lib.optionalAttrs (haskellLib.isExecutableType componentId) {
|
||||
# Set main executable name for executable components, so that `nix run` in
|
||||
# nix flakes will work correctly. When not set, `nix run` would (typically
|
||||
# erroneously) deduce the executable name from the derivation name and
|
||||
# attempt to run, for example,
|
||||
# `/nix/store/...-project-exe-app-0.1.0.0/bin/project-exe-app` instead of
|
||||
# `/nix/store/...-project-exe-app-0.1.0.0/bin/app`.
|
||||
mainProgram = exeName;
|
||||
};
|
||||
|
||||
propagatedBuildInputs =
|
||||
|
Loading…
Reference in New Issue
Block a user