Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
86 lines (77 loc) · 2.21 KB
/
Copy pathflake.nix
File metadata and controls
86 lines (77 loc) · 2.21 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
80
81
82
83
84
85
86
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
rust-overlay.url = "github:oxalica/rust-overlay";
crane.url = "github:ipetkov/crane";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
};
outputs = {
nixpkgs,
rust-overlay,
crane,
flake-utils,
...
}:
flake-utils.lib.eachSystem [flake-utils.lib.system.x86_64-linux] (
system: let
overlays = [(import rust-overlay)];
pkgs = import nixpkgs {
inherit system overlays;
};
schemathesis = import ./nix/schemathesis.nix {inherit pkgs;};
shellScripts = import ./nix/scripts.nix {inherit pkgs;};
flare = import ./nix/package.nix {
inherit pkgs crane;
root = ./.;
};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs;
[
(rust-bin.stable.latest.default.override {
extensions = ["llvm-tools-preview"];
})
cargo-audit
cargo-edit
cargo-llvm-cov
cargo-nextest
sea-orm-cli
schemathesis
botan3
openssl
python313
postgresql_18
valkey
]
++ shellScripts;
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
shellHook = ''
export NIX_SHELL_DIR="$PWD/.nix-shell"
export PGDATA="$NIX_SHELL_DIR/postgres"
export VALKEY_DATA="$NIX_SHELL_DIR/valkey"
export PG_BASE=postgres://flare:12345@localhost:5432
export PG_PASSWORD=12345
unset CI
'';
};
packages.default = pkgs.dockerTools.buildImage {
name = "flare";
tag = "latest";
created = "now";
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [flare];
pathsToLink = ["/bin" "/flare"];
};
config = {
WorkingDir = "/flare";
Cmd = ["flare"];
};
};
}
);
}