-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
129 lines (129 loc) · 4.75 KB
/
flake.nix
File metadata and controls
129 lines (129 loc) · 4.75 KB
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
{
description = "Mova - Mobile org-agenda client";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
nixgl.url = "github:nix-community/nixGL";
org-agenda-api.url = "github:colonelpanic8/org-agenda-api";
};
outputs = inputs @ {
self,
nixpkgs,
flake-utils,
nixgl,
org-agenda-api,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
overlays = [nixgl.overlay];
};
nodejs = pkgs.nodejs_22;
buildToolsVersion = "36.0.0";
cmdLineToolsVersion = "8.0";
androidComposition = pkgs.androidenv.composeAndroidPackages {
cmdLineToolsVersion = cmdLineToolsVersion;
toolsVersion = "26.1.1";
platformToolsVersion = "35.0.2";
buildToolsVersions = [buildToolsVersion "35.0.0" "34.0.0"];
includeEmulator = true;
platformVersions = ["35" "36"];
includeSources = false;
includeSystemImages = true;
systemImageTypes = ["google_apis_playstore"];
abiVersions = ["x86_64"];
includeNDK = true;
ndkVersions = ["27.1.12297006" "27.0.12077973" "26.1.10909125"];
cmakeVersions = ["3.22.1"];
useGoogleAPIs = true;
useGoogleTVAddOns = false;
};
android-sdk = androidComposition.androidsdk;
android-home = "${androidComposition.androidsdk}/libexec/android-sdk";
aapt2Binary = "${android-home}/build-tools/${buildToolsVersion}/aapt2";
sharedDeps = with pkgs; [
nodejs
yarn
watchman
alejandra
just
];
in {
devShells = {
android = pkgs.mkShell {
buildInputs =
sharedDeps
++ [pkgs.jdk17]
++ (
if system == "x86_64-linux"
then [pkgs.nixgl.auto.nixGLDefault pkgs.nixgl.nixGLIntel]
else []
);
LC_ALL = "en_US.UTF-8";
LANG = "en_US.UTF-8";
ANDROID_HOME = android-home;
ANDROID_SDK_ROOT = android-home;
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${aapt2Binary}";
shellHook = ''
export JAVA_HOME=${pkgs.jdk17.home}
export PATH=${android-home}/emulator:${android-home}/cmdline-tools/${cmdLineToolsVersion}/bin:$(pwd)/node_modules/.bin:$PATH
export ORG_AGENDA_API_DIR="${org-agenda-api}"
echo "Mova Android dev shell"
echo " node: $(node --version)"
echo " yarn: $(yarn --version)"
echo ""
echo "Commands:"
echo " yarn start - Start Expo dev server"
echo " yarn android - Run on Android"
echo " yarn web - Run in browser"
echo " just emulator - Start Android emulator"
echo " just --list - Show all just commands"
'';
};
ios = (pkgs.mkShell.override {stdenv = pkgs.stdenvNoCC;}) {
disallowedRequisites = [pkgs.xcbuild pkgs.xcbuild.xcrun];
buildInputs = sharedDeps ++ [pkgs.cocoapods pkgs.ruby pkgs.bundler];
LC_ALL = "en_US.UTF-8";
LANG = "en_US.UTF-8";
shellHook = ''
unset DEVELOPER_DIR
export PATH="$PWD/node_modules/.bin:$PWD/vendor/bundle/bin:$PATH"
export ORG_AGENDA_API_DIR="${org-agenda-api}"
export BUNDLE_PATH="$PWD/vendor/bundle"
export GEM_HOME="$PWD/vendor/bundle"
echo "Mova iOS dev shell"
echo " node: $(node --version)"
echo " yarn: $(yarn --version)"
echo " ruby: $(ruby --version)"
echo ""
echo "Commands:"
echo " yarn start - Start Expo dev server"
echo " yarn ios - Run on iOS"
echo " yarn web - Run in browser"
echo " just --list - Show all just commands"
echo ""
echo "Fastlane:"
echo " bundle install - Install fastlane dependencies"
echo " bundle exec fastlane archive - Build iOS archive"
'';
};
default = pkgs.mkShell {
buildInputs = sharedDeps;
LC_ALL = "en_US.UTF-8";
LANG = "en_US.UTF-8";
shellHook = ''
export PATH="$PWD/node_modules/.bin:$PATH"
export ORG_AGENDA_API_DIR="${org-agenda-api}"
echo "Mova dev shell (use 'nix develop .#ios' or 'nix develop .#android' for platform-specific shells)"
echo " node: $(node --version)"
echo " yarn: $(yarn --version)"
'';
};
};
});
}