Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 740fa4dc5b32
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2c91b4358afa
Choose a head ref

Commits on Jun 15, 2020

  1. impy: init at 0.1

    fgaz committed Jun 15, 2020

    Unverified

    The committer email address is not verified.
    Copy the full SHA
    d3e96b4 View commit details
  2. evilpixie: init at 0.2

    fgaz committed Jun 15, 2020

    Unverified

    The committer email address is not verified.
    Copy the full SHA
    21720b4 View commit details

Commits on Jun 19, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b7a9229 View commit details
  2. nixos/wasabibackend: init

    mmahut committed Jun 19, 2020
    Copy the full SHA
    b62df8a View commit details
  3. tests/wasabibackend: init

    mmahut committed Jun 19, 2020
    Copy the full SHA
    75e1819 View commit details
  4. nixos/wasabibackend: fixing description

    Co-authored-by: 1000101 <b1000101@pm.me>
    mmahut and 1000101 authored Jun 19, 2020
    Copy the full SHA
    d07ba3e View commit details
  5. bitcoind-knots: init at 0.20.0

    mmahut committed Jun 19, 2020
    Copy the full SHA
    ca2ed56 View commit details

Commits on Jun 20, 2020

  1. Copy the full SHA
    e3ef6f6 View commit details
  2. Copy the full SHA
    a52ec56 View commit details
  3. maintainers: added aciceri

    aciceri committed Jun 20, 2020
    Copy the full SHA
    a04315f View commit details
  4. navidrome: init at 0.23.1

    aciceri committed Jun 20, 2020
    Copy the full SHA
    70fa933 View commit details
  5. Merge pull request #90884 from mmahut/wasabi

    nixos/wasabibackend: init 1.1.11.1
    mmahut authored Jun 20, 2020
    Copy the full SHA
    0ff1bdb View commit details
  6. Merge pull request #91117 from mmahut/bitcoin-knots

    bitcoind-knots: init at 0.20.0
    mmahut authored Jun 20, 2020
    Copy the full SHA
    847ddfc View commit details
  7. Copy the full SHA
    b59fbf7 View commit details
  8. Merge pull request #88928 from aciceri/navidrome

    navidrome: init at 0.23.1
    rnhmjoj authored Jun 20, 2020
    Copy the full SHA
    bc5843f View commit details
  9. Merge pull request #90515 from fgaz/evilpixie/init

    impy,evilpixie: init
    timokau authored Jun 20, 2020
    Copy the full SHA
    40178ea View commit details
  10. zstd: Fix cross

    CMake is a build-time dep, so we need to override it with
    `buildPackages`, explicitly.
    Ericson2314 committed Jun 20, 2020
    Copy the full SHA
    a997afb View commit details
  11. pythonPackages.pyatmo: add missing dependencies

    delroth authored and Jon committed Jun 20, 2020
    Copy the full SHA
    b092390 View commit details
  12. Merge pull request #91177 from Ericson2314/fix-zstd-cross

    zstd: Fix cross
    flokli authored Jun 20, 2020
    Copy the full SHA
    4cdd64d View commit details
  13. vimPlugins: update

    shihanng authored and Jon committed Jun 20, 2020
    Copy the full SHA
    cf0b491 View commit details
  14. vimPlugins.gotests-vim: init at 2019-04-10

    shihanng authored and Jon committed Jun 20, 2020
    Copy the full SHA
    f2b3814 View commit details
  15. trellis: 2020.03.25 -> 2020.06.12

    Signed-off-by: Austin Seipp <aseipp@pobox.com>
    thoughtpolice committed Jun 20, 2020
    Copy the full SHA
    4f2d6de View commit details
  16. icestorm: 2019.09.13 -> 2020.04.22

    Signed-off-by: Austin Seipp <aseipp@pobox.com>
    thoughtpolice committed Jun 20, 2020
    Copy the full SHA
    45400f3 View commit details
  17. nextpnr: 2020.03.25 -> 2020.06.12

    Signed-off-by: Austin Seipp <aseipp@pobox.com>
    thoughtpolice committed Jun 20, 2020
    Copy the full SHA
    4891fac View commit details
  18. yosys: 2020.06.16 -> 2020.06.19

    Signed-off-by: Austin Seipp <aseipp@pobox.com>
    thoughtpolice committed Jun 20, 2020
    Copy the full SHA
    2c91b43 View commit details
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
@@ -139,6 +139,12 @@
githubId = 1517066;
name = "Aiken Cairncross";
};
aciceri = {
name = "Andrea Ciceri";
email = "andrea.ciceri@autistici.org";
github = "aciceri";
githubId = 2318843;
};
acowley = {
email = "acowley@gmail.com";
github = "acowley";
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
@@ -757,6 +757,7 @@
./services/networking/v2ray.nix
./services/networking/vsftpd.nix
./services/networking/wakeonlan.nix
./services/networking/wasabibackend.nix
./services/networking/websockify.nix
./services/networking/wg-quick.nix
./services/networking/wicd.nix
158 changes: 158 additions & 0 deletions nixos/modules/services/networking/wasabibackend.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{ config, lib, pkgs, ... }:

let
cfg = config.services.wasabibackend;

inherit (lib) mkEnableOption mkIf mkOption optionalAttrs optionalString types;

confOptions = {
BitcoinRpcConnectionString = "${cfg.rpc.user}:${cfg.rpc.password}";
} // optionalAttrs (cfg.network == "mainnet") {
Network = "Main";
MainNetBitcoinP2pEndPoint = "${cfg.endpoint.ip}:${toString cfg.endpoint.port}";
MainNetBitcoinCoreRpcEndPoint = "${cfg.rpc.ip}:${toString cfg.rpc.port}";
} // optionalAttrs (cfg.network == "testnet") {
Network = "TestNet";
TestNetBitcoinP2pEndPoint = "${cfg.endpoint.ip}:${toString cfg.endpoint.port}";
TestNetBitcoinCoreRpcEndPoint = "${cfg.rpc.ip}:${toString cfg.rpc.port}";
} // optionalAttrs (cfg.network == "regtest") {
Network = "RegTest";
RegTestBitcoinP2pEndPoint = "${cfg.endpoint.ip}:${toString cfg.endpoint.port}";
RegTestBitcoinCoreRpcEndPoint = "${cfg.rpc.ip}:${toString cfg.rpc.port}";
};

configFile = pkgs.writeText "wasabibackend.conf" (builtins.toJSON confOptions);

in {

options = {

services.wasabibackend = {
enable = mkEnableOption "Wasabi backend service";

dataDir = mkOption {
type = types.path;
default = "/var/lib/wasabibackend";
description = "The data directory for the Wasabi backend node.";
};

customConfigFile = mkOption {
type = types.nullOr types.path;
default = null;
description = "Defines the path to a custom configuration file that is copied to the user's directory. Overrides any config options.";
};

network = mkOption {
type = types.enum [ "mainnet" "testnet" "regtest" ];
default = "mainnet";
description = "The network to use for the Wasabi backend service.";
};

endpoint = {
ip = mkOption {
type = types.str;
default = "127.0.0.1";
description = "IP address for P2P connection to bitcoind.";
};

port = mkOption {
type = types.port;
default = 8333;
description = "Port for P2P connection to bitcoind.";
};
};

rpc = {
ip = mkOption {
type = types.str;
default = "127.0.0.1";
description = "IP address for RPC connection to bitcoind.";
};

port = mkOption {
type = types.port;
default = 8332;
description = "Port for RPC connection to bitcoind.";
};

user = mkOption {
type = types.str;
default = "bitcoin";
description = "RPC user for the bitcoin endpoint.";
};

password = mkOption {
type = types.str;
default = "password";
description = "RPC password for the bitcoin endpoint. Warning: this is stored in cleartext in the Nix store! Use <literal>configFile</literal> or <literal>passwordFile</literal> if needed.";
};

passwordFile = mkOption {
type = types.nullOr types.path;
default = null;
description = "File that contains the password of the RPC user.";
};
};

user = mkOption {
type = types.str;
default = "wasabibackend";
description = "The user as which to run the wasabibackend node.";
};

group = mkOption {
type = types.str;
default = cfg.user;
description = "The group as which to run the wasabibackend node.";
};
};
};

config = mkIf cfg.enable {

systemd.tmpfiles.rules = [
"d '${cfg.dataDir}' 0770 '${cfg.user}' '${cfg.group}' - -"
];

systemd.services.wasabibackend = {
description = "wasabibackend server";
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
environment = {
DOTNET_PRINT_TELEMETRY_MESSAGE = "false";
DOTNET_CLI_TELEMETRY_OPTOUT = "true";
};
preStart = ''
mkdir -p ${cfg.dataDir}/.walletwasabi/backend
${if cfg.customConfigFile != null then ''
cp -v ${cfg.customConfigFile} ${cfg.dataDir}/.walletwasabi/backend/Config.json
'' else ''
cp -v ${configFile} ${cfg.dataDir}/.walletwasabi/backend/Config.json
${optionalString (cfg.rpc.passwordFile != null) ''
CONFIGTMP=$(mktemp)
cat ${cfg.dataDir}/.walletwasabi/backend/Config.json | ${pkgs.jq}/bin/jq --arg rpconnection "${cfg.rpc.user}:$(cat "${cfg.rpc.passwordFile}")" '. + { BitcoinRpcConnectionString: $rpconnection }' > $CONFIGTMP
mv $CONFIGTMP ${cfg.dataDir}/.walletwasabi/backend/Config.json
''}
''}
chmod ug+w ${cfg.dataDir}/.walletwasabi/backend/Config.json
'';
serviceConfig = {
User = cfg.user;
Group = cfg.group;
ExecStart = "${pkgs.wasabibackend}/bin/WasabiBackend";
ProtectSystem = "full";
};
};

users.users.${cfg.user} = {
name = cfg.user;
group = cfg.group;
description = "wasabibackend daemon user";
home = cfg.dataDir;
isSystemUser = true;
};

users.groups.${cfg.group} = {};

};
}
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
@@ -345,6 +345,7 @@ in
vault = handleTest ./vault.nix {};
victoriametrics = handleTest ./victoriametrics.nix {};
virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {};
wasabibackend = handleTest ./wasabibackend.nix {};
wireguard = handleTest ./wireguard {};
wordpress = handleTest ./wordpress.nix {};
xandikos = handleTest ./xandikos.nix {};
38 changes: 38 additions & 0 deletions nixos/tests/wasabibackend.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "wasabibackend";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ mmahut ];
};

nodes = {
machine = { ... }: {
services.wasabibackend = {
enable = true;
network = "testnet";
rpc = {
user = "alice";
port = 18332;
};
};
services.bitcoind = {
enable = true;
testnet = true;
rpc.users = {
alice.passwordHMAC = "e7096bc21da60b29ecdbfcdb2c3acc62$f948e61cb587c399358ed99c6ed245a41460b4bf75125d8330c9f6fcc13d7ae7";
};
};
};
};

testScript = ''
start_all()
machine.wait_for_unit("wasabibackend.service")
machine.wait_until_succeeds(
"grep 'Wasabi Backend started' /var/lib/wasabibackend/.walletwasabi/backend/Logs.txt"
)
machine.sleep(5)
machine.succeed(
"grep 'Config is successfully initialized' /var/lib/wasabibackend/.walletwasabi/backend/Logs.txt"
)
'';
})
41 changes: 41 additions & 0 deletions pkgs/applications/blockchains/bitcoin-knots.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{ stdenv
, fetchFromGitHub
, pkgconfig
, autoreconfHook
, db5
, openssl
, boost
, zlib
, miniupnpc
, libevent
, protobuf
, utillinux
}:

stdenv.mkDerivation rec {
pname = "bitcoind-knots";
version = "0.20.0";
versionDate = "20200614";

src = fetchFromGitHub {
owner = "bitcoinknots";
repo = "bitcoin";
rev = "v${version}.knots${versionDate}";
sha256 = "0c8k1154kcwz6q2803wx0zigvqaij1fi5akgfqlj3yl57jjw48jj";
};

nativeBuildInputs = [ pkgconfig autoreconfHook ];
buildInputs = [ openssl db5 openssl utillinux
protobuf boost zlib miniupnpc libevent ];

configureFlags = [ "--with-incompatible-bdb"
"--with-boost-libdir=${boost.out}/lib" ];

meta = with stdenv.lib; {
description = "An enhanced Bitcoin node software";
homepage = "https://bitcoinknots.org/";
license = licenses.mit;
maintainers = [ maintainers.mmahut ];
platforms = platforms.linux;
};
}
98 changes: 98 additions & 0 deletions pkgs/applications/blockchains/wasabibackend/create_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p dotnet-sdk_3 nixfmt

# Run this script to generate deps.nix
# ./create_deps.sh /path/to/package/source/checkout > deps.nix

# TODO: consolidate with other dotnet deps generation scripts by which
# this script is inspired:
# - pkgs/servers/nosql/eventstore/create-deps.sh
# - pkgs/development/dotnet-modules/python-language-server/create_deps.sh

URLBASE="https://www.nuget.org/api/v2/package"

DEPS_HEADER="
{ fetchurl }:
let
nugetUrlBase = \"$URLBASE\";
fetchNuGet = { name, version, sha256 }: fetchurl {
inherit sha256;
url = \"\${nugetUrlBase}/\${name}/\${version}\";
};
in ["

DEPS_FOOTER="]"

DEPS_TEMPLATE="
(fetchNuGet {
name = \"%s\";
version = \"%s\";
sha256 = \"%s\";
})"


function generate_restore_log() {
checkout_path=$1
>&2 echo "generating restore log for $checkout_path..."
cd $checkout_path
dotnet nuget locals all --clear
dotnet restore -v normal --no-cache WalletWasabi.Backend -r linux-x64
cd -
}

function process_restore_log() {
restore_log=$1
>&2 echo "processing restore log..."
while read line; do
if echo $line | grep -q "^[[:space:]]*Installing"; then
l=$(echo $line | xargs)
l=${l#Installing }
l=${l%.}
echo $l
fi
done < $restore_log
}

function prefetch_deps() {
processed_log=$1
>&2 echo "prefetching deps..."
while read line; do
name=$(echo $line | cut -d' ' -f1)
>&2 echo "prefetching '$name' version: $version"
version=$(echo $line | cut -d' ' -f2)
hash=$(nix-prefetch-url "$URLBASE/$name/$version" 2>/dev/null)
echo "$name $version $hash"
done < $processed_log
}

function generate_deps_expression() {
packages=$1
>&2 echo "generating deps nix-expression..."
echo $DEPS_HEADER
while read line; do
name=$(echo $line | cut -d' ' -f1)
version=$(echo $line | cut -d' ' -f2)
hash=$(echo $line | cut -d' ' -f3)
printf "$DEPS_TEMPLATE" $name $version $hash
done < $packages
echo $DEPS_FOOTER
}

function main() {
checkout_path=$1
tmpdir=$(mktemp -d)
generate_restore_log $checkout_path > $tmpdir/restore.log
process_restore_log $tmpdir/restore.log > $tmpdir/processed.log
prefetch_deps $tmpdir/processed.log > $tmpdir/prefetched.log
generate_deps_expression $tmpdir/prefetched.log > $tmpdir/deps.nix
nixfmt $tmpdir/deps.nix
cat $tmpdir/deps.nix
rm -rf $tmpdir
}

if [ ! -d "$1" ]; then
>&2 echo "First argument must be a directory, the path to the package source checkout"
exit 1
fi

main $@
Loading