-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflake.nix
More file actions
79 lines (68 loc) · 2.08 KB
/
Copy pathflake.nix
File metadata and controls
79 lines (68 loc) · 2.08 KB
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
73
74
75
76
77
78
79
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
};
outputs =
inputs@{
nixpkgs,
flake-parts,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
perSystem =
{ system, pkgs, ... }:
{
formatter = pkgs.treefmt.withConfig {
runtimeInputs = [
pkgs.nixfmt
pkgs.rustfmt
];
settings = {
on-unmatched = "info";
formatter.nixfmt = {
command = "nixfmt";
includes = [ "*.nix" ];
};
formatter.rustfmt = {
command = "rustfmt";
includes = [ "*.rs" ];
};
};
};
packages.default =
let
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
in
pkgs.rustPlatform.buildRustPackage {
inherit version;
pname = "seabird-plugin-bundle";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [ pkgs.protobuf ];
# sqlx uses the checked-in .sqlx cache instead of a live database.
SQLX_OFFLINE = true;
# Flake builds run against the git tree without a .git directory, so
# git_version can't read the hash. Stamp a stable version string for
# the introspection plugin to report instead.
SEABIRD_GIT_VERSION = "v${version}-nix";
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
pkgs.cargo
pkgs.rustc
pkgs.rust-analyzer
pkgs.sqlx-cli
pkgs.protobuf
pkgs.sqlite
];
RUST_BACKTRACE = 1;
DATABASE_URL = "sqlite://seabird.db";
};
};
};
}