Commit Graph

29 Commits

Author SHA1 Message Date
Rebecca Turner
a64766913f
writeShellApplication: Add runtimeEnv argument 2024-02-01 16:02:33 -08:00
Rebecca Turner
ac20bcf449
writeShellApplication: Add bashOptions argument 2024-02-01 16:02:32 -08:00
Valentin Gagarin
eaebe13ebd doc: use markdown backticks for code tokens 2024-01-15 23:03:14 +01:00
Valentin Gagarin
2392daed23
Merge pull request #277534 from mcdonc/doc-trivial-builders-writetext
* doc: improve documentation for trivial text writing functions

Co-authored-by: Brian Merchant <bzm3r@proton.me>
Co-authored-by: Robert Hensing <robert@roberthensing.nl>
Co-authored-by: Alexander Groleau <alex@proof.construction>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-01-15 22:34:40 +01:00
Robert Hensing
559d06bbb2 trivial-builders: Remove redundant docs - link instead 2024-01-15 09:02:45 +01:00
Andrew Marshall
52c27352ce applyPatches: skip creating additional drv when no patches
If there are no `patches` or `postPatch`, then this will just do work to
make something equivalent to `src`. Instead, just return `src` in that
case.
2024-01-12 15:49:24 -05:00
Valentin Gagarin
25c0077a31 doc: add note on which variables are effective
The build log of the following won't output `foo` as one might expect, but the
`$PATH` set by stdenv.

```nix
with import <nixpkgs> {};
runCommand "foo" { PATH = "foo"; } "echo $PATH; touch $out"
```
2024-01-08 12:16:19 +01:00
Valentin Gagarin
7ae1fdc9a7 doc: reformat 2024-01-08 12:16:03 +01:00
Robert Scott
035d1e2cf9 trivial-builders: add onlyBin 2023-12-02 14:47:36 +00:00
Yueh-Shun Li
409f95731e shellcheck-minimal: init
Expose the minimal and stripped shellcheck package used by writeShellApplication.
2023-11-01 06:23:04 +08:00
con-f-use
0f3fa9e6ef writeShellApplication: exclude shell checks 2023-10-15 12:10:50 +02:00
Artturin
8a77757b7e writers.writeCBin: fix binary name when cross-compiling
`$name` contains cross-compilation info `bin/wrapped-argv0-aarch64-unknown-linux-gnu`

name should not be set directly.
2023-09-21 04:13:45 +03:00
figsoda
eee0a82ee0
Merge pull request #251369 from srid/writeShellApplication-meta 2023-09-01 16:53:49 -04:00
Sridhar Ratnakumar
250d324776
trivial-builders: add meta to writeShellApplication 2023-08-25 09:38:21 -04:00
Maximilian Bosch
850af44435
applyPatches: fix adding meta information 2023-08-20 11:51:21 +02:00
Raito Bezarius
ccbd98db50
trivial-builders/applyPatches: carry meta information to the patched source
There is no reason to not carry licenses and other information to any patched source.

This should improve our metadata in those situations.
2023-08-20 11:49:14 +02:00
Charlie Moog
0b4c5d23cd
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.
2023-08-11 00:40:37 -05:00
Francesco Gazzetta
b2e987dd16
Merge pull request #240348 from fgaz/write-shell-application/check-platforms
writeShellApplication: use shellcheck only where supported
2023-08-09 12:17:46 +02:00
Francesco Gazzetta
2c5990f03a writeShellApplication: use shellcheck only where supported 2023-08-05 18:31:20 +02:00
K900
8bd0cd850b requireFile: fix error message with SRI hashes 2023-08-04 15:34:30 +03:00
Robert Hensing
d1dc8384ca writeCBin: Add meta.mainProgram
... and add tests.
2023-07-26 18:22:26 +02:00
Naïm Favier
9be0bfb5e0
runCommand: don't set meta.position if meta is given
Fixes #242093 without breaking #237589

If `meta` is given we probably already have position information, so no
need to get it from the arguments.
2023-07-07 19:12:35 +02:00
Artturin
fb8fdc33e8 makeSetupHook: unbreak structuredAttrsByDefault 2023-06-30 19:38:26 +03:00
Naïm Favier
2e6013cf1b
runCommand: set meta.position from the arguments
Currently all packages defined by a call to runCommand have their
meta.position pointing to trivial-builders.nix.

This change makes uses of runCommand that supply at least one attribute
in the second argument point to the right file.
2023-06-14 23:27:45 +02:00
figsoda
137dd249c5 writeTextFile: revert workaround for executable = null 2023-05-31 09:25:18 -04:00
figsoda
4431bab003 writeTextFile: fix when executable is not a bool 2023-05-29 15:48:49 -04:00
figsoda
4b94ae4bc6 writeTextFile: set meta.mainProgram based on destination 2023-05-27 12:39:53 -04:00
Yueh-Shun Li
b29d5f60b8 writeScriptBin, writeShellScriptBin: add meta.mainProgram automatically 2023-05-26 04:54:03 +08:00
Sandro
cac19e0266
trivial-builders: move into the directory named alike (#223429)
While searching for something different I wondered why there is a
trivial-builders.nix file next to the trivial-builders directory where
only tests live. Lets fix that.
2023-05-06 00:16:26 +02:00