nix-bitcoin/pkgs
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
..
build-support pkgs: add fetch-node-modules 2022-08-21 19:11:51 +02:00
clboss clboss: 0.12 -> 0.13A 2022-05-30 19:09:55 +00:00
clightning-mistune-workaround clightning: fix build 2022-08-21 10:23:33 +02:00
clightning-plugins internal scripts: use pinned, cached pkgs 2022-08-28 23:49:12 +02:00
clightning-rest internal scripts: use pinned, cached pkgs 2022-08-28 23:49:12 +02:00
joinmarket internal scripts: use pinned, cached pkgs 2022-08-28 23:49:12 +02:00
krops internal scripts: use pinned, cached pkgs 2022-08-28 23:49:12 +02:00
liquid-swap pkgs: add meta attr 2021-12-15 14:39:31 +01:00
lndinit internal scripts: use pinned, cached pkgs 2022-08-28 23:49:12 +02:00
netns-exec lightning-loop: allow RPC access from main netns 2020-10-29 21:21:29 +01:00
nixops nixops: remove libvirtd plugin 2021-02-23 10:36:30 +00:00
python-packages internal scripts: use pinned, cached pkgs 2022-08-28 23:49:12 +02:00
rtl internal scripts: use pinned, cached pkgs 2022-08-28 23:49:12 +02:00
secp256k1 joinmarket: bump secp256k1 to version used upstream 2022-03-06 14:28:02 +00:00
spark-wallet internal scripts: use pinned, cached pkgs 2022-08-28 23:49:12 +02:00
default.nix cl-rest: 0.7.2 -> 0.8.0 2022-08-21 19:11:51 +02:00
generate-secrets-deprecated.nix examples/shell.nix: Add upgrade note for NixOps users 2021-09-15 12:01:37 +02:00
lib.nix improve comments, descriptions 2022-07-15 01:50:11 +02:00
nixpkgs-pinned.nix add flake support 2021-08-26 12:45:10 +02:00
pinned.nix clightning: fix build 2022-08-21 10:23:33 +02:00