forked from pyth-network/pyth-agent
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
58 lines (54 loc) · 1.64 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
# Note:
#
# This file provides a Flake for Nix/NixOs users. It allows users to
# build or work with the project without having to worry about which
# dependencies are required. It is not required to build the project
# and can be ignored by users who do not use Nix/NixOs.
#
# See README for instructions on building the project.
#
#
# Usage:
#
# ```bash
# $ nix build # Build
# $ nix develop # Instant Dev Environment
# $ nix run . -- <args...> # Run pyth-agent without installing.
# ```
#
# You can still run `nix-shell` if you prefer to not use flakes.
{
description = "Pyth Agent";
nixConfig.bash-prompt = "\[nix@pyth-agent\]$ ";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.fenix.url = "github:nix-community/fenix";
inputs.fenix.inputs.nixpkgs.follows = "nixpkgs";
outputs =
{ self
, nixpkgs
, fenix
, flake-utils
}:
# Generate a Flake Configuration for each supported system.
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
shell = import ./shell.nix { inherit pkgs; };
rust = pkgs.makeRustPlatform {
inherit (fenix.packages.${system}.minimal)
rustc
cargo;
};
in
{
devShells.default = shell;
packages.default = rust.buildRustPackage {
pname = "pyth-agent";
version = "0.0.1";
src = ./.;
cargoLock = { lockFile = ./Cargo.lock; };
};
}
);
}