-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathflake.nix
138 lines (131 loc) · 4.05 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# ==============================================================================
# Copyright (c) 2016-present Allan CORNET (Nelson)
# ==============================================================================
# This file is part of the Nelson.
# =============================================================================
# LICENCE_BLOCK_BEGIN SPDX-License-Identifier: LGPL-3.0-or-later
# LICENCE_BLOCK_END
# ==============================================================================
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
# System override for macOS
effectiveSystem = if builtins.match ".*-darwin" system != null then "aarch64-darwin" else system;
pkgs = import nixpkgs { system = effectiveSystem; };
isDarwin = pkgs.stdenv.isDarwin;
in {
devShells.default = with pkgs; mkShell {
name = "Default development shell";
packages = [
nixpkgs-fmt
cmake
pkg-config
gnumake
ninja
just
git
nodejs_20
] ++ lib.optionals (!isDarwin) [
xvfb-run
gdb
]++ lib.optionals (isDarwin) [
lldb
];
nativeBuildInputs = [
cmake
pkg-config
qt6.qtbase
qt6.wrapQtAppsHook
makeWrapper
];
buildInputs = [
qt6.full
mpich
fftw
fftwFloat
icu
zlib
boost
openssl
hdf5
curl
libgit2
libsndfile
eigen
portaudio
openblasCompat
taglib
matio
giflib
libtiff
python313
] ++ lib.optionals isDarwin [
llvmPackages.libcxx
llvmPackages.openmp
coreutils
libiconv
darwin.apple_sdk.frameworks.CoreAudio
darwin.apple_sdk.frameworks.Accelerate
] ++ lib.optionals (!isDarwin) [
alsa-oss
alsa-lib
libjack2
];
shellHook = ''
export ${if isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"}="${
pkgs.lib.makeLibraryPath (
[
zlib
fftw
fftwFloat
openblasCompat
icu
boost
openssl
mpi
hdf5
curl
libgit2
libsndfile
portaudio
eigen
taglib
matio
qt6.full
giflib
libtiff
python313
]
++ lib.optionals isDarwin [
llvmPackages.openmp
darwin.apple_sdk.frameworks.CoreAudio
darwin.apple_sdk.frameworks.Accelerate
]
++ lib.optionals (!isDarwin) [
pipewire.jack
]
)
}:$${if isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"}"
if [ -f package.json ] && [ ! -d node_modules ]; then
echo "📦 Installing npm dependencies..."
npm install
fi
# Export prefix variables for specific libraries
export NIX_LIBTIFF_PREFIX="${pkgs.libtiff}"
export NIX_GIFLIB_PREFIX="${pkgs.giflib}"
export LC_ALL=C
export QT_XCB_GL_INTEGRATION=none
export NIX_ENFORCE_NO_NATIVE=0
echo ""
echo "⭐ Welcome to the Nelson development environment ⭐"
echo ""
'';
};
});
}
# ==============================================================================