forked from jaredramirez/db_sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
54 lines (53 loc) · 1.7 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { nixpkgs, utils, rust-overlay, ... } @ inputs:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
overlays = [ (import rust-overlay) ];
inherit system;
};
in
{
defaultPackage = with pkgs; rustPlatform.buildRustPackage {
pname = "db_sync";
version = "1.0.3";
src = ./.;
cargoHash = "sha256-l1vL2ZdtDRxSGvP0X/l3nMw8+6WF67KPutJEzUROjg8=";
cargoLock = {
lockFile = ./Cargo.lock;
allowBuiltinFetchGit = true;
};
nativeBuildInputs = [ cmake llvmPackages_latest.llvm rustPlatform.bindgenHook ];
buildInputs = if stdenv.isLinux then [ ] else [ libiconv darwin.apple_sdk.frameworks.SystemConfiguration ];
};
devShell = with pkgs;
mkShell {
buildInputs = [
cargo
postgresql_15
python311Packages.sqlparse
rust-bin.beta.latest.default
darwin.apple_sdk.frameworks.SystemConfiguration
cmake
rustc
rustfmt
pre-commit
rustPackages.clippy
libiconv
llvmPackages_latest.llvm
];
LOCAL_DB_URL = "postgresql://postgres:postgres@localhost:54322/postgres";
PGHOST = "localhost";
PGPORT = "54322";
PGUSER = "postgres";
PGPASSWORD = "postgres";
PGDATABASE = "postgres";
};
}
);
}