forked from juspay/hyperswitch
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
50 lines (47 loc) · 1.6 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
{
description = "hyperswitch";
inputs = {
cargo2nix.url = "github:cargo2nix/cargo2nix/release-0.11.0";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
perSystem = { self', pkgs, system, ... }:
let
rustVersion = "1.65.0";
rustPkgs = pkgs.rustBuilder.makePackageSet {
inherit rustVersion;
packageFun = import ./Cargo.nix;
};
frameworks = pkgs.darwin.apple_sdk.frameworks;
in
{
_module.args.pkgs = import nixpkgs {
inherit system;
overlays = [ inputs.cargo2nix.overlays.default (import inputs.rust-overlay) ];
};
packages = rec {
router = (rustPkgs.workspace.router { }).bin;
default = router;
};
apps = {
router-scheduler = {
type = "app";
program = "${self'.packages.router}/bin/scheduler";
};
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
openssl
pkg-config
exa
fd
rust-bin.stable.${rustVersion}.default
] ++ lib.optionals stdenv.isDarwin [ frameworks.CoreServices frameworks.Foundation ]; # arch might have issue finding these libs.
};
};
};
}