-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
72 lines (65 loc) · 2.01 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
62
63
64
65
66
67
68
69
70
71
72
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
systems.url = "github:nix-systems/default";
devenv.url = "github:ELD/devenv/fix-rust-with-processes";
# Rust support
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, devenv, systems, ... } @ inputs:
let
forEachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
devShells = forEachSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
env = {
DATABASE_URL = "postgres://localhost:5432/integration";
};
services = {
postgres = {
enable = true;
listen_addresses = "127.0.0.1";
};
};
languages = {
rust.enable = true;
rust.version = "stable";
};
packages = with pkgs; [
sccache
darwin.DarwinTools
] ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [
frameworks.CoreFoundation
frameworks.Security
frameworks.SystemConfiguration
]);
pre-commit = {
settings = {
clippy.denyWarnings = true;
clippy.allFeatures = true;
clippy.offline = false;
};
hooks = {
cargo-check.enable = true;
clippy.enable = true;
rustfmt.enable = true;
};
};
}
];
};
});
};
}