diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-01-11 12:36:39 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-01-11 12:36:39 +0100 |
commit | 93ad6430edf3d7efa5948d1e0ca0447e4666b121 (patch) | |
tree | 3fb9c41cf3b877e22f3a5c229c0db9adc0720a98 /src/nix/flake-prefetch.md | |
parent | 7480f2bf20479641ec010153c12842c7cbf26789 (diff) |
nix store prefetch-tarball -> nix flake prefetch
Diffstat (limited to 'src/nix/flake-prefetch.md')
-rw-r--r-- | src/nix/flake-prefetch.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nix/flake-prefetch.md b/src/nix/flake-prefetch.md new file mode 100644 index 000000000..a1cf0289a --- /dev/null +++ b/src/nix/flake-prefetch.md @@ -0,0 +1,28 @@ +R""( + +# Examples + +* Download a tarball and unpack it: + + ```console + # nix flake prefetch https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.5.tar.xz + Downloaded 'https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.5.tar.xz?narHash=sha256-3XYHZANT6AFBV0BqegkAZHbba6oeDkIUCDwbATLMhAY=' + to '/nix/store/sl5vvk8mb4ma1sjyy03kwpvkz50hd22d-source' (hash + 'sha256-3XYHZANT6AFBV0BqegkAZHbba6oeDkIUCDwbATLMhAY='). + ``` + +* Download the `dwarffs` flake (looked up in the flake registry): + + ```console + # nix flake prefetch dwarffs --json + {"hash":"sha256-VHg3MYVgQ12LeRSU2PSoDeKlSPD8PYYEFxxwkVVDRd0=" + ,"storePath":"/nix/store/hang3792qwdmm2n0d9nsrs5n6bsws6kv-source"} + ``` + +# Description + +This command downloads the source tree denoted by flake reference +*flake-url*. Note that this does not need to be a flake (i.e. it does +not have to contain a `flake.nix` file). + +)"" |