diff options
author | Charlie Moog <moogcharlie@gmail.com> | 2023-08-11 00:09:11 -0500 |
---|---|---|
committer | Charlie Moog <moogcharlie@gmail.com> | 2023-08-11 00:40:37 -0500 |
commit | 0b4c5d23cdaaf8729e3653a246860823333c35d4 (patch) | |
tree | d4cf4cb07fe8848acb3274381ca96383b80203fc /pkgs/build-support/trivial-builders | |
parent | 713b27ad4766f432442a8146d31648aaffe262e7 (diff) | |
download | nixpkgs-0b4c5d23cdaaf8729e3653a246860823333c35d4.tar nixpkgs-0b4c5d23cdaaf8729e3653a246860823333c35d4.tar.gz nixpkgs-0b4c5d23cdaaf8729e3653a246860823333c35d4.tar.bz2 nixpkgs-0b4c5d23cdaaf8729e3653a246860823333c35d4.tar.lz nixpkgs-0b4c5d23cdaaf8729e3653a246860823333c35d4.tar.xz nixpkgs-0b4c5d23cdaaf8729e3653a246860823333c35d4.tar.zst nixpkgs-0b4c5d23cdaaf8729e3653a246860823333c35d4.zip |
trivial-builders: add meta.mainProgram to writeShellScriptBin
Derivations built with `writeShellScriptBin` should always be runnable with `nix run`. At present, the derivation is missing both `meta.mainProgram` and `pname`– this means that `nix run` falls back to inferring the bin path from `name`. This is unreliable and depends on faulty heuristics. For context, reference the following snippet from `nix run --help`: If installable evaluates to a derivation, it will try to execute the program <out>/bin/<name>, where out is the primary output store path of the derivation, and name is the first of the following that exists: · The meta.mainProgram attribute of the derivation. · The pname attribute of the derivation. · The name part of the value of the name attribute of the derivation.
Diffstat (limited to 'pkgs/build-support/trivial-builders')
-rw-r--r-- | pkgs/build-support/trivial-builders/default.nix | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index 0c63cc5a9be..7c4d204df40 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -304,6 +304,7 @@ rec { checkPhase = '' ${stdenv.shellDryRun} "$target" ''; + meta.mainProgram = name; }; /* |