-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e47db2
commit 4971b1c
Showing
6 changed files
with
244 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
target | ||
__pycache__ | ||
.vscode | ||
.idea | ||
.idea | ||
result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ members = [ | |
"teos", | ||
"teos-common", | ||
"watchtower-plugin" | ||
] | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
description = "Build teos (The Eye of Satoshi) server and plugin"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; | ||
|
||
crane.url = "github:ipetkov/crane"; | ||
|
||
fenix = { | ||
url = "github:nix-community/fenix"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = | ||
{ | ||
nixpkgs, | ||
crane, | ||
fenix, | ||
flake-utils, | ||
... | ||
}: | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
|
||
inherit (pkgs) lib; | ||
|
||
craneLib = (crane.mkLib pkgs).overrideToolchain fenix.packages.${system}.stable.minimalToolchain; | ||
|
||
commonArgs = { | ||
strictDeps = true; | ||
|
||
nativeBuildInputs = [ | ||
pkgs.pkg-config | ||
pkgs.openssl | ||
pkgs.rustfmt # needed for tonic build | ||
]; | ||
|
||
buildInputs = | ||
[ ] | ||
++ lib.optionals pkgs.stdenv.isDarwin [ | ||
# Additional darwin specific inputs can be set here | ||
pkgs.libiconv | ||
]; | ||
|
||
PROTOC = "${pkgs.protobuf}/bin/protoc"; | ||
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; | ||
}; | ||
|
||
fileSetForCrate = | ||
crate: | ||
lib.fileset.toSource { | ||
root = ./.; | ||
fileset = lib.fileset.unions [ | ||
./Cargo.toml | ||
./Cargo.lock | ||
./teos-common | ||
./teos | ||
./watchtower-plugin | ||
crate | ||
]; | ||
}; | ||
|
||
plugin = craneLib.buildPackage ( | ||
commonArgs | ||
// { | ||
pname = "watchtower-plugin"; | ||
cargoExtraArgs = "-p watchtower-plugin"; | ||
src = fileSetForCrate ./watchtower-plugin; | ||
inherit (craneLib.crateNameFromCargoToml { cargoToml = ./watchtower-plugin/Cargo.toml; }) version; | ||
} | ||
); | ||
teos = craneLib.buildPackage ( | ||
commonArgs | ||
// { | ||
pname = "teos"; | ||
cargoExtraArgs = "-p teos"; | ||
src = fileSetForCrate ./teos; | ||
inherit (craneLib.crateNameFromCargoToml { cargoToml = ./teos/Cargo.toml; }) version; | ||
} | ||
); | ||
in | ||
{ | ||
packages = { | ||
inherit plugin teos; | ||
default = teos; | ||
}; | ||
|
||
apps = { | ||
plugin = flake-utils.lib.mkApp { drv = plugin; }; | ||
teos = flake-utils.lib.mkApp { drv = teos; }; | ||
}; | ||
|
||
formatter = pkgs.nixfmt-rfc-style; | ||
|
||
checks = { | ||
inherit teos plugin; | ||
}; | ||
|
||
devShells.default = craneLib.devShell { | ||
packages = commonArgs.buildInputs ++ commonArgs.nativeBuildInputs; | ||
}; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters