nix-bitcoin/pkgs/python-packages
Erik Arvstedt af115d746b
internal scripts: use pinned, cached pkgs
Instead of setting up the script PATH via nix-shell, use
`nix shell` with inputs from the nix-bitcoin flake.
Advantages:
- Uses the nixpkgs version from the nix-bitcoin flake instead of
  `<nixpkgs>` from the user env (NIX_PATH), so the script runtime
  env is reproducible.
- The pkg derivations for the runtime env are cached, which greatly
  increases script startup speed.

This commit was generated by running the following script inside the
repo root dir:

def transform(path, src)
  if src =~ /#! *nix-shell +-i +bash +-p +(.*)/
    pkgs = $1
    if src =~ /^.*?(set -e.*?pipefail)\n/
      set_statement = $1
      src.sub!($&, '')
    end
    src.sub!(/\A.*?#! *nix-shell.*?\n/m, '')

    parents = ([ '..' ] * (path.split('/').count - 1)).join('/')

    [
      '#!/usr/bin/env bash',
      *set_statement,
      %(. "${BASH_SOURCE[0]%/*}/#{parents}/helper/run-in-nix-env" "#{pkgs}" "$@"),
      nil,
      src
    ].join("\n")
  end
end

Dir['**/*.sh'].each do |f|
  src = File.read(f)
  if new_src = transform(f, src)
    puts "Changed file #{f}"
    File.write(f, new_src)
  end
end
2022-08-28 23:49:12 +02:00
..
bencoderpyx move python packages to pkgs/python-packages 2020-11-18 20:21:34 -06:00
chromalog treewide: remove unneeded string literals 2021-02-07 22:41:29 +01:00
coincurve nbPython3Packages: fix clightning pkgs 2022-05-06 13:36:06 +00:00
jmbase joinmarket: 0.8.1 -> 0.8.2 2021-03-10 13:33:49 +00:00
jmbitcoin joinmarket: simplify pkgs 2022-05-06 13:35:32 +00:00
jmclient update nixpkgs 2022-07-22 13:15:25 +00:00
jmdaemon joinmarket: simplify pkgs 2022-05-06 13:35:32 +00:00
pylightning update nixpkgs-{stable,unstable} 2021-08-14 17:57:49 +00:00
pyln-bolt7 nbPython3Packages: fix clightning pkgs 2022-05-06 13:36:06 +00:00
pyln-client nbPython3Packages: fix clightning pkgs 2022-05-06 13:36:06 +00:00
pyln-proto nbPython3Packages: fix clightning pkgs 2022-05-06 13:36:06 +00:00
python-bitcointx internal scripts: use pinned, cached pkgs 2022-08-28 23:49:12 +02:00
runes python-packages/runes: init at 0.4.0 2022-02-23 20:43:12 +01:00
sha256 python-packages/sha256: init at 0.1 2022-02-23 20:48:57 +01:00
specific-versions fix python packages on nixos-22.05 2022-06-28 00:09:26 +02:00
txzmq add txzmq python pkg 2020-11-18 20:21:34 -06:00
urldecode move python packages to pkgs/python-packages 2020-11-18 20:21:34 -06:00
default.nix clightning: fix build 2022-08-21 10:23:33 +02:00