Commit Graph

30 Commits

Author SHA1 Message Date
Erik Arvstedt
e96ff7075e treewide: rename maintainer earvstedt -> erikarvstedt 2023-06-01 02:56:22 -07:00
Erik Arvstedt
ada564c1ea add compatibility with Nix PR #6530 (Source tree abstraction)
Avoid adding flake resource paths to the store (via string
interpolation).
This reduces performance and can lead to modules getting imported
twice, once through a local path and once through a store path.

This might not be needed in a future Nix release, in which case we can
revert this.
2023-06-01 02:56:22 -07:00
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
5ab85cb2a5
pkgs: add meta attr
Also add more detailed `enable` option descriptions.
2021-12-15 14:39:31 +01:00
Erik Arvstedt
f4872f3334
spark-wallet: use node package lockfile 2021-12-15 10:58:04 +01:00
nixbitcoin
8433933251
node2nix composition: add writeShellScript 2021-12-08 12:38:22 +00:00
nixbitcoin
f739bc5174
spark-wallet: 0.2.17 -> 0.3.1 2021-11-09 15:19:14 +00:00
nixbitcoin
852c112603
Use HTTPS URL for spark-wallet GitHub node packages
Manually patch spark-wallet until
https://github.com/svanderburg/node2nix/pull/269 is merged
2021-11-02 14:07:28 +00:00
Erik Arvstedt
3aab1fc267
spark-wallet: update to new node-env 2021-08-14 10:46:41 +02: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
nixbitcoin
89dc836f94
Update spark-wallet 0.2.12 -> 0.2.13 2020-04-17 14:13:04 +02:00
Jonas Nick
d68b77c0ca
spark-wallet 0.2.9 -> 0.2.12 2020-01-13 08:23:19 +00:00
William Casarin
a152c19945 spark-wallet: 0.2.8 -> 0.2.9 2019-10-18 00:34:39 +02:00
Jonas Nick
b4e635c0d2
Re-run spark-wallet generate.sh to pin newer packages 2019-06-21 09:22:32 +00:00
Jonas Nick
5a0e58b9d0
Update spark-wallet package to 0.2.8 2019-06-11 21:59:40 +00:00
Clemens Fruhwirth
a0b4d5b932 node2nix packages: Regenerate node2nix output. 2019-03-26 14:31:07 +01:00
Clemens Fruhwirth
ed0903b9cc node2nix packages: Style-fix 2019-03-26 14:31:04 +01:00
Clemens Fruhwirth
d569d1bb59 node2nix packages: Remove unnecessary node-pre-gyp 2019-03-26 14:31:02 +01:00
Clemens Fruhwirth
2250644f82 node2nix packages: Replace tgz reference with symbolic one.
This is almost equivalent except that with symbolic reference node2nix
consults the NPM registry for package.json information instead of the
package.json in the tgz file. The registry canonicalizes the
"dependencies" attribute in that it adds all "optionalDependencies",
which the npm binary would do for local package.json files, but
node2nix does not.

For spark-wallet optionalDependencies are not listed in the tgz
distributed package.json, hence node2nix misses them. This leads to a
missing qrcode-terminal package and spark-wallet dying when called
with -Q.
2019-03-26 14:30:58 +01: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