-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdevenv.nix
38 lines (33 loc) · 880 Bytes
/
devenv.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
{ pkgs, lib, config, inputs, ... }: {
packages = [
pkgs.bacon
pkgs.pkg-config
pkgs.openssl
pkgs.cmake
];
languages.rust.enable = true;
# Build the project
scripts.build.exec = ''
cargo build --release
'';
# Check the formatting of the project
scripts.check-fmt.exec = ''
cargo fmt --all -- --check
'';
enterTest = ''
echo "Running tests"
git --version | grep --color=auto "${pkgs.git.version}"
'';
# Darwin-specific configurations
env = lib.mkMerge [
{
env.OPENSSL_DIR = "${pkgs.openssl.dev}";
env.OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib";
# Common environment variables here
}
(lib.mkIf pkgs.stdenv.isDarwin {
# Darwin-specific environment variables
NIX_LDFLAGS = "-F${pkgs.darwin.apple_sdk.frameworks.Security}/Library/Frameworks -framework Security";
})
];
}