forked from bluecatengineering/dora
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.nix
More file actions
44 lines (38 loc) · 993 Bytes
/
package.nix
File metadata and controls
44 lines (38 loc) · 993 Bytes
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
{
pkgs ? import <nixpkgs> {},
lib,
...
}:
pkgs.rustPlatform.buildRustPackage {
pname = "dora";
version = (builtins.fromTOML (lib.readFile ./bin/Cargo.toml)).package.version;
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
# disable tests
checkType = "debug";
doCheck = false;
nativeBuildInputs = with pkgs; [
installShellFiles
pkg-config
];
buildInputs = with pkgs; [
pkg-config
openssl
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
];
# We need to create a testing database for the binary to compile
# because of post-build tests.
DATABASE_URL = "sqlite://./em.db?mode=rwc";
preBuild = with pkgs; ''
${sqlx-cli}/bin/sqlx database create
${sqlx-cli}/bin/sqlx migrate run
'';
# postInstall = with lib; ''
# installShellCompletion --cmd ${pname}\
# --bash ./autocompletion/${pname}.bash \
# --fish ./autocompletion/${pname}.fish \
# --zsh ./autocompletion/_${pname}
# '';
}