Commit Graph

15 Commits

Author SHA1 Message Date
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
Otto Sabart a59c3b4b8a
shellcheck: fix lint of package helper bash scripts 2022-08-28 18:25:37 +02:00
Erik Arvstedt 2106a2cdea
spark-wallet/generate.sh: remove TODO-EXTERNAL
It makes sense in general to explicitly set the nodejs version.
2022-06-28 00:09:25 +02:00
Jonas Nick 636d508b50
spark-wallet: use nodejs 14 instead of 12 since latter is EOL 2022-06-01 12:37:28 +00:00
Jonas Nick ffabad225b
spark-wallet: switch from nodejs 10 to 12
nixpkgs starts marking nodejs 10 as insecure because it is end of life.
2022-01-20 21:59:01 +00:00
nixbitcoin bb9f0b54ca
spark-wallet: use HTTPS instead of SSH for Github 2022-01-01 19:12:20 +01:00
Erik Arvstedt f4872f3334
spark-wallet: use node package lockfile 2021-12-15 10:58:04 +01:00
nixbitcoin f739bc5174
spark-wallet: 0.2.17 -> 0.3.1 2021-11-09 15:19:14 +00:00
Erik Arvstedt d214605b32
spark-wallet: add flakes compatibility
Pure flakes can't use NIX_PATH.
2021-03-16 12:46:19 +01:00
Erik Arvstedt 81db927f66
spark-wallet/generate: remove supplement.json
This file is empty and has no effect.
2021-03-16 12:46:19 +01:00
nixbitcoin 1f2f910774
spark-wallet: 0.2.16 -> 0.2.17 2020-10-18 16:00:06 +00:00
Jonas Nick 6a2efccdf3
spark-wallet: 0.2.14 -> 0.2.16
This will be required for clightning 0.9.0
2020-08-25 12:40:47 +00:00
Jonas Nick 438dde84fe
Replace sks-keyservers.net with keyserver.ubuntu.com
sks-keyservers fail most of the time.
2020-08-25 12:39:54 +00:00
nixbitcoin 8b2ae9c1b7
spark-wallet: update 0.2.13 -> 0.2.14
Download shesek's github spark-npm.tgz, verify signature, unpack
spark-npm.tgz, patch package.json to include qrcode-terminal in
dependencies, run node2nix with tmpdir as local source, replace tmpdir
spark-wallet source with shesek's github spark-npm.tgz in
node-packages.nix.

spark-wallet: erikarvstedt fixups
2020-05-10 17:12:45 +02:00
Clemens Fruhwirth 5e40066c7f nanopos, lightning-charge and spark-wallet: Package via node2nix
The strategy of invoking node2nix inside a derivation (installPhase in
this case) does not work, as under NixOS installations there is no
network traffic allowed during a derivation build. Hence, we move
node2nix outside and rewrite the packaging into the modules.

Also switch to callPackage instead of plain imports. This could
probably be done on all other imported packages inside of
nix-bitcoin-pkgs.nix.
2019-03-25 14:32:55 +01:00