mirror of
https://github.com/ZmnSCPxj/clboss.git
synced 2026-08-13 12:33:20 +02:00
Build clboss package with nix flake
This commit is contained in:
parent
3b3f4b7851
commit
67c2f86cca
6 changed files with 92 additions and 47 deletions
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
|
|
@ -7,11 +7,11 @@ jobs:
|
|||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v22
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: nix develop --command bash -c "autoreconf -i && ./configure && make -j4 distcheck"
|
||||
- run: nix flake check
|
||||
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -47,3 +47,5 @@ coverage-html/
|
|||
*.gcno
|
||||
*.gcov
|
||||
*.gcov.json.gz
|
||||
|
||||
result
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{ pkgs ? import (builtins.fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz";
|
||||
}) {} }:
|
||||
{
|
||||
pkgs ? import (builtins.fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz";
|
||||
}) { },
|
||||
}:
|
||||
|
||||
let
|
||||
poetry2nix = import (builtins.fetchGit {
|
||||
|
|
@ -16,4 +18,3 @@ pkgs.mkShell {
|
|||
})
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
11
flake.lock
generated
11
flake.lock
generated
|
|
@ -20,15 +20,16 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1692270513,
|
||||
"narHash": "sha256-xu23SOtq8DhqbFzyr+z89xUMh12J/10eyXrih1ifwq4=",
|
||||
"owner": "nixos",
|
||||
"lastModified": 1759831965,
|
||||
"narHash": "sha256-vgPm2xjOmKdZ0xKA6yLXPJpjOtQPHfaZDRtH+47XEBo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1abef55f64479d6fcd2c309a00a5ff419e793a85",
|
||||
"rev": "c9b6fb798541223bbb396d287d16f43520250518",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
|
|
|
|||
93
flake.nix
93
flake.nix
|
|
@ -3,38 +3,79 @@
|
|||
nixConfig.bash-prompt = "\[nix-develop\]$ ";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
packages = {
|
||||
default = pkgs.neofetch;
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
nativeBuildInputs = [
|
||||
pkgs.autoconf-archive
|
||||
pkgs.autoreconfHook
|
||||
pkgs.pkg-config
|
||||
pkgs.libev
|
||||
pkgs.libunwind
|
||||
pkgs.curlWithGnuTls
|
||||
pkgs.sqlite
|
||||
];
|
||||
clboss = pkgs.stdenv.mkDerivation {
|
||||
name = "clboss";
|
||||
src = ./.;
|
||||
inherit nativeBuildInputs;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
preBuild = ''
|
||||
./generate_commit_hash.sh
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "Automated Core Lightning Node Manager";
|
||||
homepage = "https://github.com/ZmnSCPxj/clboss";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
mainProgram = "clboss";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
packages.default = clboss;
|
||||
checks.default = clboss.overrideAttrs (old: {
|
||||
doCheck = true;
|
||||
checkPhase = ''
|
||||
make -j4 distcheck
|
||||
'';
|
||||
});
|
||||
formatter = pkgs.nixfmt-tree;
|
||||
|
||||
formatter = pkgs.nixpkgs-fmt;
|
||||
devShell = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
gcc
|
||||
pkg-config
|
||||
libev
|
||||
libevdev
|
||||
curl
|
||||
libunwind
|
||||
sqlite
|
||||
bind
|
||||
autoconf
|
||||
autoconf-archive
|
||||
libtool
|
||||
automake
|
||||
git
|
||||
devShells.default = pkgs.mkShell {
|
||||
inherit nativeBuildInputs;
|
||||
buildInputs =
|
||||
with pkgs;
|
||||
nativeBuildInputs
|
||||
++ [
|
||||
gcc
|
||||
libevdev
|
||||
bind
|
||||
autoconf
|
||||
autoconf-archive
|
||||
libtool
|
||||
automake
|
||||
git
|
||||
|
||||
# editor support
|
||||
bear
|
||||
];
|
||||
# editor support
|
||||
bear
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
18
shell.nix
18
shell.nix
|
|
@ -1,12 +1,12 @@
|
|||
(import
|
||||
(
|
||||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
|
||||
fetchTarball {
|
||||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}
|
||||
)
|
||||
{ src = ./.; }
|
||||
(import (
|
||||
let
|
||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||
in
|
||||
fetchTarball {
|
||||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}
|
||||
) { src = ./.; }
|
||||
# Since a lot of existing CI tests is based on `shell.nix`
|
||||
# we forward to the integrationTests shell, instead of the
|
||||
# default (developer) shell.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue