Skip to content

Commit

Permalink
meta: support nix flake for buliding
Browse files Browse the repository at this point in the history
As noted in [1] on Linux systems, it is not possible to build phoenixd due to a mismatch in the libc version.

A possible solution is to use Nix and build phoenixd inside the shell with all the dependencies. This way, the host machine can use the binary directly without downgrading libc, which can be dangerous.

[1] ACINQ#1 (comment)
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
  • Loading branch information
vincenzopalazzo committed Nov 7, 2024
1 parent 3072963 commit 3c8860f
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
61 changes: 61 additions & 0 deletions flake.lock

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

44 changes: 44 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
description = "Server equivalent of the popular Phoenix wallet";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-24.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ ];
};
in
{
packages = {
default = pkgs.gnumake;
};
formatter = pkgs.nixpkgs-fmt;

devShell = pkgs.mkShell {
buildInputs = with pkgs; [
# build dependencies
sqlite
curl
jdk

pkg-config
ncurses
stdenv.cc.cc.lib

git
];

shellHook = ''
# FIXME: this need to go in a build task
./gradlew linuxX64DistZip
'';
};
}
);
}

0 comments on commit 3c8860f

Please sign in to comment.