-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
75 lines (66 loc) · 1.77 KB
/
shell.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
73
74
75
{ pkgs ? import <nixpkgs> { } }:
let
getLibFolder = pkg: "${pkg}/lib";
getFramwork = pkg: "${pkg}/Library/Frameworks";
darwinOptions =
if pkgs.stdenv.isDarwin then ''
-F${(getFramwork pkgs.darwin.apple_sdk.frameworks.Security)}
-F${(getFramwork pkgs.darwin.apple_sdk.frameworks.CoreFoundation)}
-F${(getFramwork pkgs.darwin.apple_sdk.frameworks.CoreServices)}
-F${(getFramwork pkgs.darwin.apple_sdk.frameworks.SystemConfiguration)}
'' else "";
in
pkgs.stdenv.mkDerivation {
name = "orchestra";
nativeBuildInputs = with pkgs; [
# LLVM & GCC
gcc
cmake
gnumake
pkg-config
llvmPackages.llvm
llvmPackages.clang
# Hail the Nix
nixd
nixpkgs-fmt
# Launch scripts
just
# Rust
rustc
cargo
clippy
cargo-watch
rust-analyzer
# Database (Diesel)
diesel-cli
diesel-cli-ext
];
# If your'e crazy enough to use MacOS 15 Beta
# add these to your buildInputs:
# darwin.apple_sdk.frameworks.Security
# darwin.apple_sdk.frameworks.CoreServices
# darwin.apple_sdk.frameworks.CoreFoundation
# darwin.apple_sdk.frameworks.SystemConfiguration
buildInputs = with pkgs; [
# Actix Web
openssl
libressl
];
# Set Environment Variables
# RUST_BACKTRACE = 1;
NIX_LDFLAGS = "-L${(getLibFolder pkgs.libiconv)} ${darwinOptions}";
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
(getLibFolder pkgs.gcc)
(getLibFolder pkgs.libiconv)
(getLibFolder pkgs.llvmPackages.llvm)
];
shellHook = ''
# Check for existence of .env file
if [ ! -f .env ]; then
cp .env.development .env;
fi
# Export all variables (experimental)
export $(grep -v '^#' .env | xargs);
'';
}