-
-
Notifications
You must be signed in to change notification settings - Fork 81
/
devshell.nix
64 lines (64 loc) · 1.46 KB
/
devshell.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
# https://manuelplavsic.ch/articles/flutter-environment-with-nix/
{
lib,
mkShell,
pkgs,
stdenv,
appimagekit,
clang,
cmake,
dart,
dpkg,
flutter,
git,
gnome,
gtk3,
ninja,
patchelf,
pcre2,
plocate,
pkg-config,
quickemu,
rpm,
}:
mkShell rec {
FLUTTER_ROOT = flutter;
DART_ROOT = "${flutter}/bin/cache/dart-sdk";
buildInputs = [
appimagekit
clang
cmake
dart
dpkg
flutter
git
gnome.zenity
gtk3
ninja
patchelf
pcre2
plocate
pkg-config
quickemu
rpm
];
# vulkan-loader and libGL shared libs are necessary for hardware decoding
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath [ pkgs.vulkan-loader pkgs.libGL ]}";
# Packages installed via `dart pub global activate package_name` are
# located in the `$PUB_CACHE/bin` directory.
shellHook = ''
flutter pub get
yq eval pubspec.lock -o=json -P > pubspec.lock.json
flutter config --enable-linux-desktop
dart pub global activate flutter_distributor
echo "**********************************************************************"
echo "* flutter build linux --release *"
echo "* flutter_distributor package --platform=linux --targets=zip *"
echo "**********************************************************************"
if [ -z "$PUB_CACHE" ]; then
export PATH="$PATH":"$HOME/.pub-cache/bin"
else
export PATH="$PATH":"$PUB_CACHE/bin"
fi
'';
}