-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathflake.nix
89 lines (79 loc) · 2.94 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
description = "Lampo Nix Flake Shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
};
outputs = { self, nixpkgs, flake-utils, naersk }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
clightning = pkgs.clightning.overrideAttrs (oldAttrs: {
version = "master-62dd";
src = pkgs.fetchgit {
url = "https://github.com/ElementsProject/lightning";
rev = "f2551091ca3cc2e7b03a6d3766a851a025dbfd4d";
sha256 = "sha256-PdbHtMIc35zqv8dDX5TXWyzhcu2h1G/LzIyS9S1TCAQ=";
fetchSubmodules = true;
};
buildInputs = with pkgs; [ gmp libsodium sqlite zlib jq ];
postPatch = ''
patchShebangs \
tools/generate-wire.py \
tools/update-mocks.sh \
tools/mockup.sh \
tools/fromschema.py \
devtools/sql-rewrite.py
'';
configureFlags = [ "--disable-rust" "--disable-valgrind" ];
});
# Our integration tests required the cln and bitcoind
# so in this variable we declare everthin that we need
# for bitcoin and cln
cln-env-shell = [ clightning pkgs.bitcoind ];
# build rust application :)
naersk' = pkgs.callPackage naersk { };
in
rec {
# Set up the nix flake derivation
packages = {
# build the daemon binary
lampod = naersk'.buildPackage {
# name of the binary
name = "lampod-cli";
version = "0.0.1";
src = ./.;
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ bitcoind openssl ];
# lampo is broken at the moment in release mode
release = false;
};
# build the lampo-cli
cli = naersk'.buildPackage {
# name of the binary
name = "lampo-cli";
version = "0.0.1";
src = ./.;
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ openssl ];
# lampo is broken at the moment in release mode
release = false;
};
# FIXME: add a target to run integration testing
# FIXME: add a target to run lnprototest
default = packages.lampod;
};
# FIXME: will be good to have this formatting also the rust code
formatter = pkgs.nixpkgs-fmt;
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ gnumake rustup openssl openssl.dev ] ++ cln-env-shell;
shellHook = ''
export HOST_CC=gcc
export RUST_BACKTRACE=1
'';
};
}
);
}