Skip to content

Commit

Permalink
Merge #617: Update to NixOS 23.05
Browse files Browse the repository at this point in the history
e658209 run-tests.sh: fix building tests for Nix ≥ 2.15 (Erik Arvstedt)
bb2e88c fix python packages for nixos 23.05 (Erik Arvstedt)
e31cc68 run-tests: make compatible with new shellcheck version (Erik Arvstedt)
76dc7b9 examples/deploy-container.sh: add extra-container version check (Erik Arvstedt)
6c2d110 update the required extra-container version for nixos 23.05 (Erik Arvstedt)
e2cce7d update to nixos 23.05 (Erik Arvstedt)
55c64d8 update nixpkgs (Erik Arvstedt)
bd77b89 rtl, clightning-rest: update to nodejs 18 (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK e658209

Tree-SHA512: 5814f56e469ad384dfb81bc11f9ac256a35cd2647e7fd997b14f84927448fbb880b0b1cee3bdf5a2b926760b74aab291e901e67a0759d43ffaf705ff6b741b97
  • Loading branch information
jonasnick committed Jul 19, 2023
2 parents 48b3604 + e658209 commit 6eaddd9
Show file tree
Hide file tree
Showing 26 changed files with 201 additions and 238 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ task:

container:
# Defined in https://github.com/nix-community/docker-nixpkgs
image: nixpkgs/nix-flakes:nixos-22.11
image: nixpkgs/nix-flakes:nixos-23.05

matrix:
- name: modules_test
Expand Down
2 changes: 1 addition & 1 deletion dev/topics/rtl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runuser -u "$(logname)" -- xdg-open "http://$ip:3000"
rtl_src=~/s/RTL
git clone https://github.com/Ride-The-Lightning/RTL "$rtl_src"

nix build -o /tmp/nix-bitcoin-dev/nodejs --inputs-from . nixpkgs#nodejs-16_x
nix build -o /tmp/nix-bitcoin-dev/nodejs --inputs-from . nixpkgs#nodejs-18_x
# Start a shell in a sandbox
env --chdir "$rtl_src" nix-bitcoin-firejail --whitelist="$rtl_src" --whitelist=/tmp/nix-bitcoin-dev/nodejs
PATH=/tmp/nix-bitcoin-dev/nodejs/bin:"$PATH"
Expand Down
4 changes: 2 additions & 2 deletions examples/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@

services.openssh = {
enable = true;
passwordAuthentication = false;
settings.PasswordAuthentication = false;
};
users.users.root = {
openssh.authorizedKeys.keys = [
Expand All @@ -292,7 +292,7 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
system.stateVersion = "23.05"; # Did you read the comment?

# The nix-bitcoin release version that your config is compatible with.
# When upgrading to a backwards-incompatible release, nix-bitcoin will display an
Expand Down
1 change: 1 addition & 0 deletions examples/deploy-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ read -rd '' src <<EOF || true
};
}
EOF
. "${BASH_SOURCE[0]%/*}"/../test/lib/extra-container-check-version.sh
extra-container shell -E "$src" "${runCmd[@]}"

# The container is automatically deleted at exit
20 changes: 10 additions & 10 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'';

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
extra-container = {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/clightning-plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let
description = "Lightning node exporter for the prometheus timeseries server";
extraPkgs = [ prometheus_client ];
patchRequirements =
"--replace prometheus-client==0.6.0 prometheus-client==0.15.0"
"--replace prometheus-client==0.6.0 prometheus-client==0.16.0"
+ " --replace pyln-client~=0.9.3 pyln-client~=23.02";
};
rebalance = {
Expand Down Expand Up @@ -79,7 +79,7 @@ let
# Check that requirements are met
PYTHONPATH='${toString python}/${python.sitePackages}' \
${pkgs.python3Packages.pip}/bin/pip install -r requirements.txt --no-cache --no-index
${pkgs.python3Packages.pip}/bin/pip install -r requirements.txt --no-cache --no-index --break-system-packages
chmod +x '${script}'
patchShebangs '${script}'
Expand Down
8 changes: 4 additions & 4 deletions pkgs/clightning-rest/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib
, stdenvNoCC
, nodejs-16_x
, nodejs-slim-16_x
, nodejs-18_x
, nodejs-slim-18_x
, fetchNodeModules
, fetchurl
, makeWrapper
Expand All @@ -17,8 +17,8 @@ let self = stdenvNoCC.mkDerivation {
};

passthru = {
nodejs = nodejs-16_x;
nodejsRuntime = nodejs-slim-16_x;
nodejs = nodejs-18_x;
nodejsRuntime = nodejs-slim-18_x;

nodeModules = fetchNodeModules {
inherit (self) src nodejs;
Expand Down
8 changes: 6 additions & 2 deletions pkgs/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ let self = {
RestrictAddressFamilies = self.defaultHardening.RestrictAddressFamilies + " AF_NETLINK";
};

# nodejs applications require memory write execute for JIT compilation
nodejs = { MemoryDenyWriteExecute = false; };
nodejs = {
# Required for JIT compilation
MemoryDenyWriteExecute = false;
# Required by nodejs >= 18
SystemCallFilter = self.defaultHardening.SystemCallFilter ++ [ "@pkey" ];
};

# Allow takes precedence over Deny.
allowLocalIPAddresses = {
Expand Down
12 changes: 6 additions & 6 deletions pkgs/pinned.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
pkgs: pkgsUnstable:
{
inherit (pkgs)
lightning-pool
lndconnect;

inherit (pkgsUnstable)
btcpayserver
charge-lnd
clightning
electrs
elementsd
extra-container
fulcrum
hwi
lndconnect;

inherit (pkgsUnstable)
btcpayserver
clightning
lightning-loop
lightning-pool
nbxplorer;

inherit pkgs pkgsUnstable;
Expand Down
22 changes: 18 additions & 4 deletions pkgs/python-packages/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
nbPkgs: python3:
let
# Ignore eval error:
# `OpenSSL 1.1 is reaching its end of life on 2023/09/11 and cannot
# be supported through the NixOS 23.05 release cycle.`
# TODO-EXTERNAL: consider removing when
# https://github.com/Simplexum/python-bitcointx/issues/76 and
# https://github.com/JoinMarket-Org/joinmarket-clientserver#1451 are resolved.
openssl_1_1 = python3.pkgs.pkgs.openssl_1_1.overrideAttrs (old: {
meta = builtins.removeAttrs old.meta [ "knownVulnerabilities" ];
});
in
rec {
pyPkgsOverrides = self: super: let
inherit (self) callPackage;
Expand All @@ -13,12 +24,15 @@ rec {
pyln-bolt7 = clightningPkg ./pyln-bolt7;
pylightning = clightningPkg ./pylightning;

# bitstring 3.1.9, required by pyln-proto
bitstring = callPackage ./specific-versions/bitstring.nix {};

# Packages only used by joinmarket
bencoderpyx = callPackage ./bencoderpyx {};
chromalog = callPackage ./chromalog {};
python-bitcointx = callPackage ./python-bitcointx {
inherit (nbPkgs) secp256k1;
openssl = super.pkgs.openssl_1_1;
openssl = openssl_1_1;
};
runes = callPackage ./runes {};
sha256 = callPackage ./sha256 {};
Expand All @@ -39,7 +53,7 @@ rec {

# cryptography 3.3.2, required by joinmarketdaemon
cryptography = callPackage ./specific-versions/cryptography {
openssl = super.pkgs.openssl_1_1;
openssl = openssl_1_1;
cryptography_vectors = callPackage ./specific-versions/cryptography/vectors.nix {};
};

Expand All @@ -49,8 +63,8 @@ rec {
# pyopenssl 21.0.0, required by joinmarketdaemon
pyopenssl = callPackage ./specific-versions/pyopenssl.nix {};

# twisted 22.4.0, required by joinmarketbase
twisted = callPackage ./specific-versions/twisted.nix {};
# txtorcon 22.0.0, required by joinmarketdaemon
txtorcon = callPackage ./specific-versions/txtorcon.nix {};
};

nbPython3Packages = (python3.override {
Expand Down
4 changes: 4 additions & 0 deletions pkgs/python-packages/jmbase/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ buildPythonPackage rec {

postUnpack = "sourceRoot=$sourceRoot/jmbase";

patchPhase = ''
sed -i 's|twisted==22.4.0|twisted==22.10.0|' setup.py
'';

propagatedBuildInputs = [ future twisted service-identity chromalog txtorcon ];

meta = with lib; {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/python-packages/jmclient/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildPythonPackage rec {
substituteInPlace setup.py \
--replace "'klein==20.6.0'" "'klein>=20.6.0'"
substituteInPlace setup.py \
--replace "'pyjwt==2.4.0'" "'pyjwt==2.5.0'"
--replace "'pyjwt==2.4.0'" "'pyjwt==2.6.0'"
'';

meta = with lib; {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/python-packages/pyln-proto/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ buildPythonPackage rec {
postUnpack = "sourceRoot=$sourceRoot/contrib/pyln-proto";

postPatch = ''
sed -i 's|cryptography = "^36.0.1"|cryptography = "^38.0.0"|' pyproject.toml
sed -i 's|cryptography = "^36.0.1"|cryptography = "^40.0"|' pyproject.toml
'';
}
40 changes: 40 additions & 0 deletions pkgs/python-packages/specific-versions/bitstring.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, unittestCheckHook
}:

buildPythonPackage rec {
pname = "bitstring";
version = "3.1.9";

src = fetchFromGitHub {
owner = "scott-griffiths";
repo = pname;
rev = "bitstring-${version}";
sha256 = "0y2kcq58psvl038r6dhahhlhp1wjgr5zsms45wyz1naq6ri8x9qa";
};

patches = [
(fetchpatch {
name = "fix-running-unit-tests-using-unittest-hook.patch";
url = "https://github.com/scott-griffiths/bitstring/commit/e5ee3fd41cad2ea761f4450b13b0424ae7262331.patch";
hash = "sha256-+ZGywIfQQcYXJlYZBi402ONnysYm66G5zE4duJE40h8=";
})
];

checkInputs = [ unittestCheckHook ];

unittestFlagsArray = [ "-s" "test" ];

pythonImportsCheck = [ "bitstring" ];

meta = with lib; {
description = "Module for binary data manipulation";
homepage = "https://github.com/scott-griffiths/bitstring";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ bjornfor ];
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ buildPythonPackage rec {

checkInputs = [
cryptography_vectors
hypothesis
# Work around `error: infinite recursion encountered`
(hypothesis.override { enableDocumentation = false; })
iso8601
pretend
pytest
pytz
];

checkPhase = ''
py.test --disable-pytest-warnings tests
${pytest}/bin/py.test --disable-pytest-warnings tests
'';

# IOKit's dependencies are inconsistent between OSX versions, so this is the best we
Expand Down
Loading

0 comments on commit 6eaddd9

Please sign in to comment.