blob: 1012f27c08abab7a99a2b912407c7d8926822fe1 (
plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs =
{ self
, nixpkgs
}:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ self.overlay ];
});
in
{
overlay = final: prev: {
prompt = with final;
let
pname = "prompt";
packageMeta = (lib.importTOML ./Cargo.toml).package;
in
final.rustPlatform.buildRustPackage {
inherit pname;
inherit (packageMeta) version;
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.CoreServices
darwin.libiconv
];
doCheck = false;
src = self;
cargoLock.lockFile = ./Cargo.lock;
};
};
packages = forAllSystems (system: {
inherit (nixpkgsFor."${system}") prompt;
});
defaultPackage =
forAllSystems (system: self.packages."${system}".prompt);
devShell = forAllSystems (system:
let
pkgs = nixpkgsFor."${system}";
in
pkgs.mkShell {
nativeBuildInputs = [
pkgs.pkgconfig
pkgs.openssl
pkgs.bacon
pkgs.rust-analyzer
pkgs.rustc
pkgs.cargo
];
RUST_LOG = "info";
RUST_BACKTRACE = 1;
});
};
}
|