-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
53 lines (51 loc) · 1.37 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
{
description = "Development Setup";
inputs = {
utils.url = "github:numtide/flake-utils";
stable.url = "github:NixOS/nixpkgs/nixos-24.05";
unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
stable,
unstable,
utils,
...
}:
utils.lib.eachDefaultSystem
(
system: let
pkgs = import stable {inherit system;};
lib = pkgs.lib;
unstable-pkgs = import unstable {inherit system;};
cross = import stable {
inherit system;
crossSystem = {config = "x86_64-unknown-linux-musl";};
};
in {
# Used by `nix develop`
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs =
[
pkgs.openssl.dev
pkgs.libiconv
unstable-pkgs.postgresql.dev
]
++ lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
];
packages = with pkgs; [
pre-commit
];
};
devShells.x86_64-unknown-linux-musl = cross.mkShell (with cross.pkgsMusl; {
nativeBuildInputs = [
pkg-config
];
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER = "${stdenv.cc.targetPrefix}cc";
});
}
);
}