Skip to content
Snippets Groups Projects
  • Bryan Richter's avatar
    5fe375a8
    nix-prefetch-url: Add --executable flag · 5fe375a8
    Bryan Richter authored
    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.
    5fe375a8
    History
    nix-prefetch-url: Add --executable flag
    Bryan Richter authored
    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.