diff options
author | Bryan Richter <bryan.richter@relexsolutions.com> | 2020-09-18 18:36:17 +0300 |
---|---|---|
committer | Bryan Richter <bryan.richter@relexsolutions.com> | 2020-09-18 19:09:45 +0300 |
commit | 5fe375a8f1d60b49835b52df48686caddaa297a4 (patch) | |
tree | 889407f1377bb240bf1a45891ff288fa99a5b1f0 /doc/manual/src/command-ref/nix-prefetch-url.md | |
parent | 958bf5712377f59622c59f05a84641aa1093fd32 (diff) |
nix-prefetch-url: Add --executable flag
pkgs.fetchurl supports an executable argument, which is especially nice
when downloading a large executable. This patch adds the same option to
nix-prefetch-url.
I have tested this to work on the simple case of prefetching a little
executable:
1. nix-prefetch-url --executable https://my/little/script
2. Paste the hash into a pkgs.fetchurl-based package, script-pkg.nix
3. Delete the output from the store to avoid any misidentified artifacts
4. Realise the package script-pkg.nix
5. Run the executable
I repeated the above while using --name, as well.
I suspect --executable would have no meaningful effect if combined with
--unpack, but I have not tried it.
Diffstat (limited to 'doc/manual/src/command-ref/nix-prefetch-url.md')
-rw-r--r-- | doc/manual/src/command-ref/nix-prefetch-url.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/manual/src/command-ref/nix-prefetch-url.md b/doc/manual/src/command-ref/nix-prefetch-url.md index 1cd1063cd..1307c7c37 100644 --- a/doc/manual/src/command-ref/nix-prefetch-url.md +++ b/doc/manual/src/command-ref/nix-prefetch-url.md @@ -51,6 +51,9 @@ Nix store is also printed. result to the Nix store. The resulting hash can be used with functions such as Nixpkgs’s `fetchzip` or `fetchFromGitHub`. + - `--executable` + Set the executable bit on the downloaded file. + - `--name` *name* Override the name of the file in the Nix store. By default, this is `hash-basename`, where *basename* is the last component of *url*. |