-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
61 lines (55 loc) · 1.54 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
59
60
61
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
devshell.url = "github:numtide/devshell";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = { self, flake-utils, rust-overlay, devshell, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (system: {
devShell =
let
pkgs = import nixpkgs {
inherit system;
overlays = [
devshell.overlays.default
(import rust-overlay)
];
};
in
pkgs.devshell.mkShell {
devshell.motd = "";
devshell.packages = [
(pkgs.rust-bin.stable."1.71.1".default.override {
extensions = ["rust-src"];
})
pkgs.protobuf
pkgs.rust-analyzer
pkgs.sqlx-cli
pkgs.sqlite
];
env = [
{
name = "RUST_BACKTRACE";
value = "1";
}
{
# We set the DATABASE_URL in a shell hook so we can reference the
# project directory, not a directory in the nix store.
name = "DATABASE_URL";
eval = "sqlite://$(git rev-parse --show-toplevel)/seabird.db";
}
];
};
});
}