The Trezor dependency (which enables support for the Trezor hardware wallet) was gated behind the
enablePythonEcdsa override prior to this change because the trezor python package used to depend on
the ecdsa python package which is marked insecure. However, modern versions of the trezor package no
longer depend on ecdsa so it should be enabled by default, like the Ledger hardware wallet package.
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.
Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
Switch to the PEP 517 build pipeline so we rely on the native
build system rather than the deprecated setuptools path.
Use pythonRelaxDepsHook to ease upstream's strict version pins
and keep protobuf available at runtime.
Starting from version 4.3.1, source-only Electrum tarball excludes
generated protobuf files.
Build generated protobuf file from electrum/paymentrequest.proto.
Tests and wrappers include protobuf dependencies to start successfully.
Some Electrum plugins use python-ecdsa which is known to be vulnerable
(CVE-2024-23342). In this commit these plugins are disabled. It is possible
to re-enable it via option enablePythonEcdsa.
The list of affected plugins:
- ckcc-protocol
- keepkey
- trezor
- bitbox02
If a Python package does not come with either `format` or `pyproject` we
consider it a setuptools build, that calls `setup.py` directly, which is
deprecated.
This change, as a first step, migrates a large chunk of these packages to
set setuptools as their explicit format
This is so we can unify the problem space for the next step of the
migration.
This reverts commit 65a333600d.
This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.
It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).
A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.
[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:
nix-build ci -A fmt.check
This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).
This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).
Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).
If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
electrum is quite strict about the aiorpcx version is accepts.
With commit 4bbf5300d4 ,
Upstream already has a patch to extend
the range of aiorpcx versions it permits:
171aa5ee5a
As the patch does not cleanly apply to the
distribution tarball we're using, we instead apply the
required changes "by hand", with `substituteInPlace`.
On top of the changes adapted from the upstream commit,
we have to change the file `./electrum/electrum`:
It is not part of the upstream source repository,
but it gets created from `./run_electrum` when
upstream creates the distribution tarball.
Note that the commit at hand is similar to
0e513f0435 .
The old `--replace` is deprecated,
we use `--replace-fail` so changes in source code that
might invalidate substitute invocations get noticed.
Cf. commit e07a2fab7f .
This reverts commit a879c72552.
It is no longer needed,
as electrum removed the PATH manipulation:
f15abd7cbd
However, this commit also deviates from a plain revert,
as it adds an additional replacement command to still
substitute the `--testnet` command line, as it was done before.
Note:
Those `--replace` calls are removed here in order to stricten
substitute calls with `--replace-fail` in a follow-up commit.
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build a08b3a4d19.tar.gz \
--argstr baseRev b32a094368
result/bin/apply-formatting $NIXPKGS_PATH
Since the update to version 5 with
7cdaa0b80c ,
the `python3Packages.protobuf` package
no longer provides the `protoc` program.
Instead, one has to add the `protobuf` package
(not the python package) directly.
In preparation for the deprecation of `stdenv.isX`.
These shorthands are not conducive to cross-compilation because they
hide the platforms.
Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way
One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059
There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.
```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
electrum is quite strict about the aiorpcx version is accepts.
With commit 97b53be707 ,
aiorpcx got updated to 0.23.1 which is too much for electrum.
Upstream already has a patch to extend the
range of aiorpcx versions it permits.
We apply that patch until a the next release of electrum.
Unfortunatelly, the patch -- which we take from the
GitHub source repository -- does not patch every file
that that is needed to be patched in the distribution tarball.
Hence we have to copy the patched file over another file
in the `postPatch` hook of the build process.
See the comments there for more information.
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.