Skip to content

Commit

Permalink
Add flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Ifropc committed Aug 8, 2024
1 parent 0564b5a commit e3f8be6
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 0 deletions.
96 changes: 96 additions & 0 deletions flake.lock

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

45 changes: 45 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
description = "stellar-cli development shell";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
in
with pkgs;
{
devShells.default = mkShell {
buildInputs = [
openssl
pkg-config
libudev-zero
jq
(rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
targets = [ "wasm32-unknown-unknown" ];
})
];
shellHook =
''
echo `nix --version`
alias stellar="cargo run --bin stellar --"
SOROBAN_SECRET_KEY=SBPXU3OP65M2DQPRM4YFZ5NME66NWWH5DHN44IBDYAN4TFKKY7CS4OHY stellar keys add dev_key
export STELLAR_NETWORK=testnet
export STELLAR_ACCOUNT=dev_key
shell=$SHELL
shell=`basename $SHELL`
source <(stellar completion --shell $shell)
'';
};
}
);
}

0 comments on commit e3f8be6

Please sign in to comment.